Closed (fixed)
Project:
Drupal core
Version:
main
Component:
configuration system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2017 at 18:01 UTC
Updated:
7 Mar 2026 at 11:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
smartparty commentedSolution found, courtesy of https://www.previousnext.com.au/blog/update-drupal-core-84-step-by-step-...
In the case of my issues, 'node' was replaced with 'commerce_product' and 'commerce_product_variation' respectively.
Comment #3
Newb_Druper commented@smartparty
I am having the same errors since I updated to 8.4
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): field name: comment_body, bundle: comment_node_gallery_item
From the code you provided(comment #2), which modules would I place this hook function in? I copy the code into one custom module and ran it through the update but I'm still getting the errors in my log.
Not sure if Im doing it right, as I don't have much Drupal experience. Thanks.
Comment #4
challeypeng commented@smartparty
I have the same problem, and no matter how I use dr entup to update file_entity module, it's always unsuccessful.
How should I do it?
Could you tell me the detail process?
Comment #5
wolfhowling commentedI to am having issues with this and creating a custom module with the code from comment #2 does not work how do i make use of that code snippet in drupal?
Comment #6
Newb_Druper commentedIt seems others are still having this issue.
I did a bit more digging and found a similar problem but in drupal 7 https://www.drupal.org/project/drupal/issues/1351506
Looking at post 5(by WormFood), the solution is to look into table “field_config_instance” and finding your bundle name that is giving errors and deleting that row.
Note - If you got to “reports->field list” you will the same errors “ Undefined Index” (mark them down)- basically the Bundle name which are the same results if you were to check the “Reports->Recent Log messages”.
In Drupal 8 the table “field_config_instance” is not there. Looking at comment 2 of this thread I looked at the code and notice the service key_value.
Key_value is a table in drupal 8 that you need to investigate. Do a mysql command and search the column “value” for your bundle name in question. For example I wanted to search the bundle “comment_node_gallery_item “ so I did statement of:
Eg. SELECT * FROM `key_value` WHERE `value` LIKE '%comment_node_gallery_item%'
Then look at field result of Value which is a longblob type string. Look at its string content and you should see the bundle names and the field that you are searching for. If you are using PHPMyAdmin you may have to right click that value and save as a bin file. You can open with texteditor.
I then deleted this row but make sure to backup this table just to be sure.
Then flush your cache. You should not get the errors in your recent logs anymore of “non-existent config entity name returned by FieldStorageConfigInterface::getBundles()…..”
I am not experienced in Drupal so I have no idea if this would have implication on the rest of the website by deleting right from the database. So someone else can try and chime in would be great.
Comment #7
uno commentedI had the same issue, leftovers from removed content type from d6 module (previous to D7 upgrade), named Flashnode. Errors were shown after upgrade to D8.
I just created new content type with the same problematic machine name (in my case flashnode), and deleted it - the warnings are gone.
Comment #8
wolfhowling commentedIn my case the problematic bundle is entity.definitions.bundle_field_map if i modify it i get serialization errors if i delete it the errors go away but the bundle never gets rebuild and that gives me pause since i don't know how that may make things go wrong in the future, is any way to rebuild this bundles after removing them? Cron, flush or database update does not do it.
Thanks.
Update 1: This could be a better solution than deleting tables.
In my case it was comment_node_article and when searching for that you will see this in the result "entity.definitions.bundle_field_map | comment " the important word here is the comment after the pipe, keep this in mind.
In my case is global so it is "C:\Users\USER\AppData\Roaming\Composer\vendor\drush\drush\commands"
the force is important other wise it will not do it since the file exist already
Notice this cannot be undone so you may want to backup the database just in case
This worked for me i have not more errors and the entity exist in my database without any problems upon inspecting the blob file i see that it removed the keys that where causing the issue and re-serialized the file so it does not give any other errors. If any one has a better option or if you find any problems with this please let me know.
A thanks to @Newb_Druper for the first code and to @swichers in github for the extension for drush all i did was put together 1 and 2 together.
Comment #9
acbramley commentedThis is caused by deleting a field via config import. I'm going to dig through the issue queue to see if there's an existing issue out there but it looks like it's due to FieldDefinitionListener::onFieldDefinitionDelete not firing when field config is deleted via config import.
Comment #10
keramsey commentedacbramley: I am getting errors related to custom fields that were added to basic page and article in Drupal 7 prior to upgrading to Drupal 8.5.5. The fields and related content seem to have migrated properly. However, I receive error messages whenever I flush caches. Any advice on how to correct the errors?
Here is one of the errors:
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): field name: media_title, bundle: default
Comment #11
uno commentedHave you tried adding that field, human name: Media Title, machine name: media_title?
You can check usage of the fields under /admin/reports/fields
Comment #12
ashwinshAs per #10, I have faced same problem with field collection field after migrating my D7 site to D 8.5.6. Got website encountered error for all admin pages.
Comment #13
pminfI get
but can not solve it with #2, because the bundle "menu_link_content" is not listed in \Drupal::service('keyvalue')->getAll().
I've noticed that there is a field.storage.menu_link_content.field_foo.yml (and no other config file related to this field). Deleting this file and trying to import leads to
Is there any other way to get rid of this field without operating directly on database level?
Comment #14
pminfReopen it because #2 does not solve it for all entity types (e.g. menu_link_content).
Comment #15
keramsey commentedSorry for the delay in responding. I checked /admin/reports/fields and see the fields listed. The associated content types contain the fields and the field contents seem to have migrated successfully.
I thought these custom fields from the old D7 site would migrate as content fields, not config fields, as the error messages seem to imply.
All 4 fields I receive errors on are listed at /admin/reports/fields as being used in '...'. The fields should belong to Basic Page and Article content types.
Are the content types not appearing in the Used In column on the field report page the issue? If so, how do I correct it?
Comment #16
keramsey commentedI am not familiar with the Drupal 8 database schema, but I would think there would be a table, or tables, that would associate fields with their associated content types (bundles). Does anyone know which table(s) are used?
Comment #17
keramsey commentedThe fields related to the 4 errors (type=view) in the recent log report when flushing all caches are field_license, field_tags, media_title, and media_description.
By querying the database table key_value using where collection='entity.definitions.bundle_field_map' and value like '%(field_name)%', I can see that the fields are related to the file type for all 4 fields and that 2 of the fields are also related to either taxonomy_term or node. Here is the break down:
field_license: file, taxonomy_term
field_tags: file, node
media_description: file
media_title: file
I found the following tables in the database related to the 4 fields:
field_license: file__field_license, taxonomy_term__field_license
field_tags: file__field_tags, node__field_tags
media_description: file__media_description
media_title: file__media_title
Of the 6 tables related to the 4 fields, the following tables are empty:
file__field_license, file__field_tags, file__media_description, file__media_title
The other 2 tables (node__field_tags, taxonomy_term__field_license) were not empty.
Not sure if this is relevant information, but the following tables are empty: file_managed, file_metadata, file_usage, media_field_data, media_field_revision, media_revision
Not sure if this is relevant information, the following tables are not empty: taxonomy_term_field_data, taxonomy_term_field_revision, taxonomy_term_hierarchy
I assume the file__* tables were not populated properly during the migration and that is what is contributing to the errors, but I am not sure how to address the issues.
Do I need to rerun the upgrade? Any ideas how to fix this?
Comment #18
keramsey commentedI noticed that I also receive 4 errors on the Field List report that I think are related to the 4 fields that did not migrate properly:
Notice: Undefined index: default in Drupal\field_ui\FieldStorageConfigListBuilder->buildRow() (line 116 of core/modules/field_ui/src/FieldStorageConfigListBuilder.php).
Comment #19
keramsey commentedFrom what I gather, the errors I am receiving are accurate and the issues are related to the site upgrade using the migrate_drupal_ui module. I will open a new issue and link to it from here once I figure out where the errors are happening (migrate_drupal or migrate_drupal_ui).
Comment #20
vmilic commentedI had the same issue, applying the solution from #8 solved it!
Comment #21
StepanISK commentedI get the following errors on the tab fields.
Is this mistake of the same choreographer or another?
I have drupal 8.6.2
Comment #22
StepanISK commentedComment #23
crash_springfield commentedI couldn't get the solution in #8 to work in 8.6 because it now uses Drush 9 but I think this works: drush 9 command to rebuild Drupal 8.4+ field mappings
Comment #24
Beau Townsend commentedMany thanks to all, especially @Newb_Druper (#6) and @wolfhowling (#8) for your helpful information. I wanted to also achieve two goals with this comment.
The first is to point out that I have encountered this error on an install of Drupal 8.7.6, that was not upgraded from a previous version. The error occurs on un-installation of a custom module in which Feeds and FeedTypes are being programmatically generated during installation. The issue for me was a feeds_item field attached to a custom entity that is also provided by the custom module.
Secondly, I had some trouble initially deciphering some of the necessary information to resolve this error. For those in a position similar to mine (including being a MySQL newb), I wanted to document the exact steps that I took while working in a MAMP environment with Drush 8.1.15 (on a Mac, obviously).
As of the commitment of this patch (https://www.drupal.org/project/drupal/issues/2985907) in 8.6.x, the FieldStorageConfigInterface error should tell you the entity type, so you won't need to investigate MySQL. If you are using a Drupal version prior to 8.6.x, use the following code to log into MySQL, then execute @Newb_Druper's SQL
# Assume $ to be a command prompt.
# Log in to MySQL (Use your DB creds)
$ mysql -u root -p# Once logged in, execute @Newb_Druper's SQL, replacing the LIKE argument with your field name.
mysql> SELECT * FROM `key_value` WHERE `value` LIKE '%your_field_name%'# Per @wolfhowling's comment (#8), look for text that reads "entity.definitions.bundle_field_map | my_entity" and take the value to the right of the pipe as the entity name.
# Exit MySQL
mysql> \q;# If you know the name of the entity, start here.
# Navigate into your .drush folder. It is most likely found @ ~/.drush
$ cd ~/.drush# Clone the rfm command extension
$ git clone https://gist.github.com/d0141a3ab14d93835d09943684480ee0.git# Navigate back to your Drupal instance
$ cd /Applications/MAMP/htdocs/drupal-8.7.6# Clear drush cache, then rebuild your field mapping.
These steps corrected the issue for me.
Comment #25
panchukExample for comment entity. I have this error when migrate d7 to d8:
And I use HOOK_update in YOURMODULENAME.module
Comment #26
nicolasambroise commentedThanks @Panchuk, I manage to fix this 3 errors
* entity type : commerce_product, bundle: product, field name : field_deadline
* entity type : commerce_product, bundle: product, field name : commerce_stock_override
* entity type : commerce_product, bundle: product, field name : commerce_stock
After that, I enable the module, I call the /update.php, I clean the cache and now the error is gone.
Comment #27
ndf commentedSame as #25 but with variables for $entity_type, $bundle and $field_name on top for readability.
Comment #28
mediameriquat commentedI have a similar error message when I submit a "Book" product in Drupal Commerce:
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: block_content, bundle: contact, field name: field_formulaire
The problem is unrelated to the product type. It stems from a WSOD that appeared while trying to put a contact form into a block. It is definitely a core issue.
--
Where should I insert the code suggested in #27 ? I don't even know which module to update. I'm on shared host w/o drush. Any help would be greatly appreciated.
Comment #29
kundu commented#27 did the trick for me.
I added it in my custom module
custom.moduleascustom_update_8001(){}.Thanks¡
Comment #30
apathak commentedSimilar questions as #2 @smartparty above:
1. Where does this code go?
1a . Do I need to write a custom module for this?
1b. What is _update_8001? (especially 8001?)
1c. How will this hook get fired in a custom module - I am getting the error after rebuilding the cache.
2. I have already tried what #6 @newb_druper suggested - it did not work for me. I am still getting the error.
Thank you for your help.
Comment #31
ndf commented#29, #30: you can add code from #27 to any module.
But I guess you did yet write a lot of modules yourself.
Therefor you can follow these guides to write your first module:
- https://www.drupal.org/docs/8/creating-custom-modules
- http://redcrackle.com/blog/say-hello-world-drupal-8-basic-steps-involved...
In all these examples the update function starts with words like my_module, YOURMODULENAME and HOOK.
You should replace that with the machine-name of your module.
Read more about hooks here: https://api.drupal.org/api/drupal/core!core.api.php/group/hooks/8.4.x
At last the 8001 part. This is an increment. In Drupal 8 it is always 8001+ and in Drupal 7 it is always 7001+.
So for your first HOOK_update() you use HOOK_update_8001().
And for your second HOOK_update() you use HOOK_update_8002(), etc, etc.
You can read more about it here: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...
Comment #32
apathak commentedHello @ndf,
Thanks a lot for your help and the detailed answer!
I have written a custom module, for example, my_module and the function my_module_update_8001()
I have installed the module (my_module). Now, my question is: how do I make sure that the function my_module_update_8001() is fired?
Thanks!
Comment #33
ndf commented@apathak,
I forgot to say that hook_update() won't run when you install a module. Only when you run the update-script.
This is intentional! The idea is that a module does everything it needs in its hook_install() function.
Example:
- Not installed module has 2x hook_update defined (i.e. hook_update_8001() and hook_update_8002() )
- The module will be installed
--- Now the drupal system does *not* run hook_update_8001() and hook_update_8002()
--- But the drupal system will register that the module is in version 8002 (hook_update with highest number)
- The get's an update that has hook_update_8003()
- You install this update and you run the update script
--- Now the drupal system *will* run hook_update_8003()
So in your case you should first install your new custom module.
Then after that increase the hook_update_N number.
Then run the update script.
Comment #34
apathak commentedHi @ndf,
Thanks again for the detailed answer.
I still have a few questions.
At the moment I am in my local environment.
1. I have installed my_module with my_module_update_8001 ()
2. How do I run the update-script after I increment the N in the hook_update_N() function?
3. When I increment the N to 8003 and try to: Administration>>Extend>>Update, I do not find my_module. How do I run the update script?
Thanks!
Comment #35
ndf commentedHi @apathak, what you wrote in #34 should work.
Our discussion is now out-of-context for this issue #2916266: How to fix "non-existent config entity name returned by FieldStorageConfigInterface::getBundles()"
I think it would be better to ask for support in Drupal Slack (https://www.drupal.org/slack) #support or ask some other drupal-developer to sit together on your issue (maybe on a local event).
Those are more helpful places for support than the core issue-queue.
Comment #36
apathak commentedHello @ndf,
This is how I ended up running "my_module" - via drush:
At the docroot, I ran the following drush command:
$ drush updb -y modules/custom/my_module
"my_module" being the module that I had written.
I was up to 8005 for my N.
Thanks for your help.
Comment #37
harishpatel86 commented@apathak,
You can enable new contributed or custom module by using below command:
drush en my_module -y.
See the reference : https://drushcommands.com/drush-8x/pm/pm-enable/
Comment #38
apathak commentedHello @ndf, and others,
Here is another question I have - after I run my hook_update_N() - the following code, I get the warning
Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 266 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
This is my code:
Help is appreciated.
Comment #39
apathak commentedHere is the full warning:
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 250)
Drupal\Core\Entity\EntityStorageBase->load() (Line: 74)
Drupal\workbench_moderation\ModerationInformation->loadBundleEntity('node_type', ) (Line: 82)
Drupal\workbench_moderation\ModerationInformation->isModeratableBundle(Object, ) (Line: 304)
Drupal\workbench_moderation\EntityTypeInfo->entityBundleFieldInfoAlter(Array, Object, ) (Line: 87)
workbench_moderation_entity_bundle_field_info_alter(Array, Object, ) (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('entity_bundle_field_info', Array, Object, ) (Line: 424)
Drupal\Core\Entity\EntityFieldManager->buildBundleFieldDefinitions('node', , Array) (Line: 338)
Drupal\Core\Entity\EntityFieldManager->getFieldDefinitions('node', ) (Line: 39)
Drupal\ctools_block\Plugin\Deriver\EntityFieldDeriver->getDerivativeDefinitions(Array) (Line: 101)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array) (Line: 87)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 284)
Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 175)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 22)
Drupal\Core\Plugin\DefaultPluginManager->getDefinition('system_menu_block:about') (Line: 16)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('system_menu_block:about', Array) (Line: 76)
Drupal\Component\Plugin\PluginManagerBase->createInstance('system_menu_block:about', Array) (Line: 62)
Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->initializePlugin('system_menu_block:about') (Line: 57)
Drupal\block\BlockPluginCollection->initializePlugin('system_menu_block:about') (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get('system_menu_block:about') (Line: 45)
Drupal\block\BlockPluginCollection->get('system_menu_block:about') (Line: 83)
Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->setConfiguration(Array) (Line: 99)
Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->addInstanceId('system_menu_block:about', Array) (Line: 55)
Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->__construct(Object, 'system_menu_block:about', Array) (Line: 34)
Drupal\block\BlockPluginCollection->__construct(Object, 'system_menu_block:about', Array, 'about') (Line: 156)
Drupal\block\Entity\Block->getPluginCollection() (Line: 145)
Drupal\block\Entity\Block->getPlugin() (Line: 118)
Drupal\block\BlockAccessControlHandler->checkAccess(Object, 'view', Object) (Line: 105)
Drupal\Core\Entity\EntityAccessControlHandler->access(Object, 'view', Object, 1) (Line: 370)
Drupal\Core\Entity\EntityBase->access('view', NULL, 1) (Line: 56)
Drupal\block\BlockRepository->getVisibleBlocksPerRegion(Array) (Line: 137)
Drupal\block\Plugin\DisplayVariant\BlockPageVariant->build() (Line: 259)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 99)
Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 694)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment #40
idflorin commentedImplemented #27 but I still get
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: node, bundle: gallery_assist, field name: field_fpimageThis is code from my module
and
https://prnt.sc/s6dh9ain blog its tag Type is "views"
"gallery_assist" existed in drupal 6 https://www.drupal.org/project/gallery_assist
now its gone.
I found in my db "www_spare_wheel_"
SELECT * FROM `www_spare_wheel_`.`key_value` WHERE (CONVERT(`collection` USING utf8) LIKE '%gallery_assist%' OR CONVERT(`name` USING utf8) LIKE '%gallery_assist%' OR CONVERT(`value` USING utf8) LIKE '%gallery_assist%')this BLOB.
It's safe to delete it?
https://prnt.sc/s6dmbpthank you.
Comment #41
idflorin commentedImplemented #27 = fixed
made: function hello_world_update_8001 install, run, uninstall, made, function hello_world_update_8002, install, run , uninstall , made function hello_world_update_8003 .. etc for how many errors do you have.
Comment #44
bmango commentedI couldn't get my_module_update_8001() to run until I realised I needed to change it to my_module_update_8801() as I was running Drupal 8.8!
Maybe this will help someone else :)
Comment #45
sseto commentedI also couldn't get my my_module_update_8801() to run until I realized I needed to change my_module_update_8901()
Hopefully this helps someone :)
Comment #46
dillix commented@apathak did you resolve this issue? I also have a lot of warnings after hook_update().
Comment #47
TomChiverton commentedStill happens on D7 to D9 conversion
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: node, bundle: poll, field name: upload
Comment #48
mogio_hh commented#27 worked with me. As on 8.9.3 I had to rename the hook to
drush updb
xxx_update_8901
drush updb
xxx_update_8902
drush updb
xxx_update_8903
Thanks for that.
Comment #49
juliyo7 commentedHI, i have this error using migrate module to migrate Drupal7 to Drupal8:
User warning: Missing file with ID 2232. en Drupal\image\Plugin\Field\FieldType\ImageItem->preSave() (línea 329 de /home/migracion/public_html/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php)
The content fields haven't migrated with that module, anyone cant help me?
Comment #50
sjhuskey commentedI'm on Drupal 8.9.6.
Here's one of many similar errors that I'm trying to fix:
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: comment, bundle: comment_node_time_slot_institution, field name: comment_bodyI created a module called scs_fix. In scs_fix.module, I inserted the code from #27, with the variables altered for my situation, and I named the function scs_fix_update_8901:
I enabled the module.
When I ran
drush updatedb, I found that there were no updates to apply.Is there some step that I'm missing?
Comment #51
dillix commented@sjhuskey I tried this way, but after update I've got a bunch of errors like this:
Comment #52
kanchamk commented#26 Worked for me. Thanks!.
Just put that code in your custom module hook_update_N function(Here N could be anything like 8001 or 8901 irrespective of your d8 version).
Run below commmand
drush updb
to see the results.
Note: if there are so many errors coming from taxonomy_term, node and paragraph etc, Just increment the N number by 1 and change entity_type to taxonomy_term, node and paragraph respectively and run above drush command every time.
Comment #53
ivnish#27 thanks!
Comment #54
chikeI upgraded from Drupal 7 to 8 and had this issue exactly the error I had was
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: comment, bundle: comment_node_fire_protection_system, field name: comment_bodyI tried #27 but after enabling the module I expected the issue to go away but it didn't. Perhaps I was supposed to run database update but I didn't think of that so I removed the module and tried @Newb_Druper's solution at #6, so I opened phpMyAdmin and deleted the entry as explained in #6 and the issue went away.
In my case it wasn't only that I was getting notices each time I enable or disable modules with Drush but if I enabled
layout_builderthe site will throw WSOD and become inaccessible till I disable layout_builder again. So after deleting the item from db I am able to enablelayout_builderand use the site without the notices.I am just hoping there are no trailing issues lurking somewhere but for now site works.
Comment #55
jprj commentedLike chike, I am upgrading from Drupal 7 to 8 (btw I'm on drupal 8.9.x). I hit the same problem, tried #27 which worked on one error, but didn't work on the second. So I tried #6. The net result is that there are no longer any errors in dblog, but I still get the WSOD, which is more frustrating. I don't have layout_builder enabled, so that should not be part of the problem (I hope). I will keep plodding away at it.
Comment #56
baluertlThank you everyone in this thread for the valuable hints. With them in mind, I was able to successfully investigate that for me the issue happened because I renamed the coreʼs
system.menu.mainconfig file to something else. Once the original "system.menu.main.yml" file was restored, the /admin/reports/fields page was loading again properly.Comment #57
brooke_heaton commentedI've run the suggested update and am now also getting the 'array_flip()' warning:
I do not suggest the solution in #27 due to the recurring errors.
Comment #58
mkrkarthi commentedI had the same error for comments, node and media. Created the respective content / comment /media types with the same bundle name and deleted it.
Errors disappeared.
Comment #59
djassie commentedCredit goes to #6 #24 and previous post of years back targeting
Drupal Version: 9.2.0 - release version

My issue:
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: node, bundle: article, field name: bodyAfter deleting
content_type: ArticleI was getting the above error, that
non-existent config entity name returned by FieldStorage ...I trying - with - the above - creating and instaling the
hook_update_Nmodule, and after installing, going tourl/update.phpordrush updb -yBut the above did not work.
Working solution, which at least worked :
In Database(MySQL Workbench, find/run query
use d77;SELECT * FROM `key_value` WHERE `value` LIKE '%article%';Now, I got only one - row, can not rember the row.
In the row, openend the blob file, in MySQL Workbench default editor. I find the value present
article.After deleting, the row, and applied, and commited.
Cleaning Cache
Now, finally, run
drush crto reload cache.When I opened the website log, now I do not get the previous error of missing error of
non-existent config entity nameComment #60
sjhuskey commentedThe solutions mentioned above (e.g., #25 and #27) work on single instances of the error, but if you have multiple errors, you can modify #27 with a
foreachstatement.I had many errors, so I wanted to fix all of them at one time. Since the error is in the form of, for example,
[error] A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: taxonomy_term, bundle: blog_category, field name: field_title, you have the beginnings of an array. I copied all of the errors, then I deleted everything but the entity type (e.g., taxonomy_term), bundle (e.g., blog_category), and field_name (e.g., field_title) and turned the result into an array of arrays. Then I usedforeachto iterate over the arrays.Here's an example:
I hope that this helps someone.
Comment #61
vrwired commentedThanks @sjhuskey, good example in #60. Also, if anyone else has issue with 'no pending updates', make sure to name file with .install extension and if that's not the issue, then increment the hook (mymodule_update_8901 to mymodule_hook_8902). It'd been a while since I did a hook update and had to recall this over again.
Comment #62
edward.peters commented#27 worked for me too, when upgrading a site from Drupal 7 straight to Drupal 9.2.7. Thank you!
Comment #63
andypostComment #64
sseto commentedI'm getting this warning after using the custom module for my D9 site:
Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 261 of C:\wamp64\www\sseto\web\core\lib\Drupal\Core\Entity\EntityStorageBase.php)
Any idea what could be the issue?
EDIT: I re-imported my old DB and used #6 way instead and it's fixed.
Comment #66
junaidpvI made solution from #27 as a Drush command. Here is a gist containing two files https://gist.github.com/junaidpv/3a5211deec20ae770e6d93a6a9d2c8bd
Instructions:
We can the drush command as:
Please use correct values for
entity_type,bundleandfield_namewith respective values from your error messages.Comment #67
cobasa commentedI got my fix from comment #66! Thanks junaidpv
Comment #68
la558 commentedI got my fix from comment #66! Thanks junaidpv
Comment #70
ihor_allin commented#60 helped me. Thank you sjhuskey
Comment #71
tmacy commentedI've run into the "non-existent config entity name returned by FieldStorageConfigInterface::getBundles" problem updating a legacy site from D7 to D8/9. As per the #2 code, I cobbled the following code for a D8 module. It worked. Note that it is a brute solution by choice.
<?php
/**
* @file
* Contains \Drupal\hello_world\Controller\HelloController.
*/
namespace Drupal\emf_tester\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* * Fix entity.definitions.bundle_field_map key store with old bundles.
*/
class BundleFixController extends ControllerBase {
/**
* Based on solution code here:
* https://www.drupal.org/project/drupal/issues/2916266
*
* Chose to use brute force method, i.e., one error at a time, to verify
* and to serve as a log of changes. Last found at bottom.
*/
public function content() {
/** @var \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory */
$key_value_factory = \Drupal::service('keyvalue');
$field_map_kv_store = $key_value_factory->get('entity.definitions.bundle_field_map');
// Caution: Set $entity_type, $bundle manually as taken for errors such as these:
//
// - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// entity type: node, bundle: image, field name: upload
// $entity_type = 'node';
// $bundle_name = 'image'; //advpoll_ranking';
// $field_name = 'upload';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: product, field name: upload
// $entity_type = 'node';
// $bundle_name = 'product';
// $field_name = 'upload';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: product_gift_dues, field name: taxonomyextra
// $entity_type = 'node';
// $bundle_name = 'product_gift_dues';
// $field_name = 'taxonomyextra';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: product_kit, field name: taxonomyextra
// $entity_type = 'node';
// $bundle_name = 'product_kit';
// $field_name = 'taxonomyextra';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: product_kit, field name: field_image_cache
// $entity_type = 'node';
// $bundle_name = 'product_kit';
// $field_name = 'field_image_cache';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: product_dues, field name: field_image_cache
// $entity_type = 'node';
// $bundle_name = 'product_dues';
// $field_name = 'field_image_cache';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: comment, bundle: comment_node_call_abstract_submission, field name: comment_body
// $entity_type = 'comment';
// $bundle_name = 'comment_node_call_abstract_submission';
// $field_name = 'comment_body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: comment, bundle: comment_node_product, field name: comment_body
// $entity_type = 'comment';
// $bundle_name = 'comment_node_product';
// $field_name = 'comment_body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: comment, bundle: comment_node_product_kit, field name: comment_body
// $entity_type = 'comment';
// $bundle_name = 'comment_node_product_kit';
// $field_name = 'comment_body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: comment, bundle: comment_node_advpoll_binary, field name: comment_body
// $entity_type = 'comment';
// $bundle_name = 'comment_node_advpoll_binary';
// $field_name = 'comment_body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: comment, bundle: comment_node_advpoll_ranking, field name: comment_body
// $entity_type = 'comment';
// $bundle_name = 'comment_node_advpoll_ranking';
// $field_name = 'comment_body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: comment, bundle: comment_node_image, field name: comment_body
// $entity_type = 'comment';
// $bundle_name = 'comment_node_image';
// $field_name = 'comment_body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: comment, bundle: comment_node_webform, field name: comment_body
// $entity_type = 'comment';
// $bundle_name = 'comment_node_webform';
// $field_name = 'comment_body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: product, field name: body
// $entity_type = 'node';
// $bundle_name = 'product';
// $field_name = 'body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: product_kit, field name: body
// $entity_type = 'node';
// $bundle_name = 'product_kit';
// $field_name = 'body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: advpoll_binary, field name: body
// $entity_type = 'node';
// $bundle_name = 'advpoll_binary';
// $field_name = 'body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: image, field name: body
// $entity_type = 'node';
// $bundle_name = 'image';
// $field_name = 'body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: comment, bundle: comment_node_product_gift_dues, field name: comment_body
// $entity_type = 'comment';
// $bundle_name = 'comment_node_product_gift_dues';
// $field_name = 'comment_body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: advpoll_ranking, field name: body
// $entity_type = 'node';
// $bundle_name = 'advpoll_ranking';
// $field_name = 'body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: product_gift_dues, field name: body
// $entity_type = 'node';
// $bundle_name = 'product_gift_dues';
// $field_name = 'body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: product, field name: field_image_cache
// $entity_type = 'node';
// $bundle_name = 'product';
// $field_name = 'field_image_cache';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: webform, field name: body
// $entity_type = 'node';
// $bundle_name = 'webform';
// $field_name = 'body';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: product_gift_dues, field name: field_image_cache
// $entity_type = 'node';
// $bundle_name = 'product_gift_dues';
// $field_name = 'field_image_cache';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // n entity type: node, bundle: product, field name: taxonomyextra
// $entity_type = 'node';
// $bundle_name = 'product';
// $field_name = 'taxonomyextra';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: advpoll_binary, field name: upload
// $entity_type = 'node';
// $bundle_name = 'advpoll_binary';
// $field_name = 'upload';
// // - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// // entity type: node, bundle: image, field name: upload
// $entity_type = 'node';
// $bundle_name = 'image';
// $field_name = 'upload';
// - A non-existent config entity name returned by FieldStorageConfigInterface::getBundles():
// entity type: node, bundle: product_conf_reg, field name: field_image_cache
$entity_type = 'node';
$bundle_name = 'product_conf_reg';
$field_name = 'field_image_cache';
//
$node_map = $field_map_kv_store->get($entity_type);
// Remove the field_dates field from the bundle field map for the page bundle.
//unset($node_map['field_dates']['bundles']['page']);
//$field_map_kv_store->set('node', $node_map);
$html = '
";
// *** Comment out next line to prevent database update. ***
//$field_map_kv_store->set($entity_type, $node_map);
return array(
'#type' => 'markup',
'#markup' => t('
'),
);
}
}
Comment #72
andypostno reason to change version as 8.x no longer supported
Comment #74
rex.barkdoll commentedI just wanted to add that #66 worked for me. Huge appreciation to @junaidpv.
I just wanted to add some additional instructions for anyone else who's facing this afterward and who doesn't do a lot of Drupal development/coding.
Creating a module to solve this issue:
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type:The contents will be:
\Drupal\my_module\Commands\UpdateCommandsto\Drupal\update_config_entity\Commands\UpdateCommands(or the name of your module)src, inside that, create a folder calledCommandsnamespace Drupal\my_module\Commands;tonamespace Drupal\update_config_entity\Commands;drush update:correct-field-config-storage entity_type bundle field_name, changing entity_type, bundle, and field_name to match the errors you're getting on your site.Just a last, casual note for others: I know this super basic level of detail might seem heavy handed, but there's so much of fixing and maintaining Drupal sites that's obfuscated and confusing. The "how to build a drupal module" guides are good, but still don't link to an example repository or boilerplate to help people get started or see an end product. I'd just like to advocate for this level of clarity in the future. (soap box rant over).
Comment #75
dadderley commentedI took over some sites that had been migrated from drupal 7 and there were all kinds of relics left over from the migration.
This has been vexing for a long time.
My dblog reports were polluted with errors like this:
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: taxonomy_term, bundle: migrate_example_wine_varieties, field name: field_variety_attributesI followed your well written instructions and now the dblog page is free from these stupid errors.
Thank you rex.barkdoll!
Comment #76
vlad.dancerComment #77
vlad.dancerWe used code from #27 and deleted all weird things.
But I would also reccomend that if "bundle_field_map" ($map) is empty after unsetting:
then it is better to remove such record:
Alternatively/additionally I would recommend to search key_value table for leftovers:
SELECT `collection`, `name`, `value` FROM `key_value` WHERE `name` LIKE '%comment%' LIMIT 0,1000;Like:
state comment.maintain_entity_statistics b:1;Comment #78
Anonymous (not verified) commentedThank you @rexbarkdoll #74 worked for me and indeed this was my first module ever.
Comment #80
butterwise commentedI, too, inherited a site that was migrated from D7 to D9 which was plagued by a couple of these annoying errors. Thank you, @rex.barkdoll, for the thorough and easy to understand instructions in #74. Worked like a charm!
Comment #81
anybodySame here as #80 so it would be quite useful to have a core cleanup tool for this.
Comment #82
koffer commentedI get some problem with a site migrated from Drupal 7 to Drupal 9 then to Drupal 10. I get a lot of error message about comments fields
Error like:
Field comment.comment_node_article.comment_body exists but is missing a corresponding field definition and may be misconfigured
I fix it creating a new field for comments and refreshing cache.
Comment #83
khurrami commentedThanks a lot #74 worked for me as well
Comment #84
luksakI improved the approach in #60 a bit:
Comment #85
jrwest_webguy commented#74 was very helpful for me as well. Thank you @junaidpv and @rex.barkdoll.
Comment #86
kmcgill7 commentedCreating a hook from #25 and expanding it to include the approach from #60 cleared the error
Comment #87
amir jamshidi commented#74 worked for me. thanks
Comment #88
mlncn commentedThis comes up on so many sites we inherit as rescues of attempted migrations, so added the work from this issue to Migration Helpers module as a few functions available to use in an update hook or a deploy hook (not drush, at the moment anyway).
If there are safe-ish ways to automatically remove invalid configurations from entity definitions bundle_field_map i would happily experiment with them there.
Comment #89
finex commentedHi, #66 and #74 solved the problem. Thank you very much :-)
Comment #90
priyaecs commentedHi
#66 fixed the errors. Thanks junaidpv
Comment #91
koppie commentedComment #66 is three years old, and yet we have no stable fix for this issue.
How about a module?
I've taken @junaidpv's excellent work and packaged it as a contrib module, ready to download with composer: https://www.drupal.org/project/update_config_entity
The only change I made was to add support for Drupal 11. Patches are welcome!
Roadmap:
Comment #92
quietone commentedThis issue is a support request and there is no MR to work on, so changing status.
The Drupal Core issue queue is not the ideal place for support requests. The 'support request' option is there for filing support issues for contributed modules and themes. There are several support options listed on our support page (Community > Support at the top of Drupal.org) and there is Drupal Slack. You may get better replies in one of those places.
Comment #94
quietone commentedI updated the issue summary directing to the comments that offered solutions.
I am closing this per the guidance in Handle or refer a support request in an issue.
Comment #97
trigve hagen commentedCreated a fix for this if you still need it. Thanks
https://www.drupal.org/project/module_cleanup