1

My boss and I have inherited a Drupal 8 site from another developer, and every attempt to do database updates or cache rebuilds triggers a fatal exception: ‘The “entity_type:block_content_type" plugin does not exist.’ We’ve updated lots of modules, redownloaded dependences, etc. and still it persists.

We're both pretty new to Drupal 8, and Google hasn't turned up much general advice on "plugin does not exist" errors. The Custom Block (block_content) module is enabled, and I think I can see where the plugin is declared, in a big comment in core/modules/block_content/src/Entity/BlockContentType.php. Beyond that, I have no clue what would make a plugin fail to be found. Can anyone shed some light on this for us?

Full stack trace:

$ drush cache-rebuild
exception 'Drupal\Component\Plugin\Exception\PluginNotFoundException' with message 'The "entity_type:block_content_type" plugin  [error]
does not exist.' in /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:52
Stack trace:
#0 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(25):
Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition(Array, 'entity_type:blo...', true)
#1 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(16):
Drupal\Core\Plugin\DefaultPluginManager->getDefinition('entity_type:blo...')
#2 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Condition/ConditionManager.php(50):
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('entity_type:blo...', Array)
#3 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(81):
Drupal\Core\Condition\ConditionManager->createInstance('entity_type:blo...', Array)
#4 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80):
Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin('entity_type:blo...')
#5 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Condition/ConditionPluginCollection.php(26):
Drupal\Component\Plugin\LazyPluginCollection->get('entity_type:blo...')
#6 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(148):
Drupal\Core\Condition\ConditionPluginCollection->get('entity_type:blo...')
#7 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(114):
Drupal\Component\Plugin\LazyPluginCollection->getIterator()
#8 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Condition/ConditionPluginCollection.php(33):
Drupal\Core\Plugin\DefaultLazyPluginCollection->getConfiguration()
#9 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(320):
Drupal\Core\Condition\ConditionPluginCollection->getConfiguration()
#10 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Entity/EntityStorageBase.php(434):
Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#11 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Entity/EntityStorageBase.php(389):
Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\block\Entity\Block))
#12 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(259):
Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\block\Entity\Block))
#13 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Entity/Entity.php(364):
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\block\Entity\Block))
#14 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(637):
Drupal\Core\Entity\Entity->save()
#15 /var/www/sites/beprobeproud/htdocs/core/modules/block/block.module(156): Drupal\Core\Config\Entity\ConfigEntityBase->save()
#16 [internal function]: block_rebuild()
#17 /var/www/sites/beprobeproud/htdocs/core/lib/Drupal/Core/Extension/ModuleHandler.php(402):
call_user_func_array('block_rebuild', Array)
#18 /var/www/sites/beprobeproud/htdocs/core/includes/common.inc(1133): Drupal\Core\Extension\ModuleHandler->invokeAll('rebuild')
#19 /var/www/sites/beprobeproud/htdocs/core/includes/utility.inc(51): drupal_flush_all_caches()
#20 /usr/local/share/drush/commands/core/cache.drush.inc(300): drupal_rebuild(Object(Composer\Autoload\ClassLoader),
Object(Symfony\Component\HttpFoundation\Request))
#21 [internal function]: drush_cache_rebuild()
#22 /usr/local/share/drush/includes/command.inc(422): call_user_func_array('drush_cache_reb...', Array)
#23 /usr/local/share/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#24 [internal function]: drush_command()
#25 /usr/local/share/drush/includes/command.inc(199): call_user_func_array('drush_command', Array)
#26 /usr/local/share/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#27 /usr/local/share/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#28 /usr/local/share/drush/drush.php(12): drush_main()
#29 {main}  
  • 1
    How old is the site exactly before you started updating it? Does it have the ctools module enabled? Someone at some point used/defined an entity_type:block_content_type condition, and ctools use to define those, but it was renamed a long time ago from entity_type:block_content_type to e.g. entity_bundle:block_content. By me, actually. – Berdir Mar 1 '17 at 17:51
  • 1
    If your site is that old, then you will have to manually fix your configuration. Try drush cex to export the config, then search for that string and similar ones, probably all in block.block.* files. Likely those are empty configurations anyway, then you can just remove them. Then import again with drush cim, and then hopefully it will work – Berdir Mar 1 '17 at 17:53
  • Site's on Drupal 8.1.9, it looks like, but it was started probably way before that. When I run drush cex I get exception 'Exception' with message 'The configuration directory type 'sync' does not exist' in htdocs/core/includes/bootstrap.inc:157 – 75th Trombone Mar 1 '17 at 17:56
  • 1
    look for $configuration_directories and change they 'staging' key to 'sync' in settings.php. And yes, this definitely started pre 8.0.0 then :) – Berdir Mar 1 '17 at 17:57
  • Actually I didn't have any configuration directories set up at all in settings.php. I did that, found the offending configuration (I believe it IS being used), and imported and it works now! Thank you! Post some of that as an answer and I'll accept it! – 75th Trombone Mar 1 '17 at 18:05
4

How old is the site exactly before you started updating it?

Does it have the ctools module enabled? Someone at some point used/defined an entity_type:block_content_type condition, and ctools use to define those, but it was renamed a long time ago from entity_type:block_content_type to e.g. entity_bundle:block_content. By me, actually.

If your site is that old, then you will have to manually fix your configuration. Try drush cex to export the config, then search for that string and similar ones, probably all in block.block.* files. Likely those are empty condition configurations anyway, then you can just remove that part of the configuration. Then import again with drush cim, and then hopefully it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.