'No such entity.' error in magento2

I am trying to setup the project in my local environment.I have changed the domain name in core_config_data table for path web/unsecure/base_url & web/secure/base_url and removed cache directory from var but still I am getting message No such entity. and errors attached at the screenshot. what is the way to resolve this?

  • have you remove your var folder from root and run command php bin/magento indexer:reindex and php bin/magento setup:upgrade – Rakesh Jesadiya May 12 '16 at 12:46
  • Yes I have run these commands – Ritika May 17 '16 at 10:52
  • Hello @Ritika ,how you resolve this issue,I have same issue for multi website.Please help me. – akgola Jul 26 '18 at 4:26

I had the same issue. It appeared to be caused by some entity ids that needed to be set to 0.

When you transfer the data the insert records on these specific records are automatically generated and tend to start at 1 and not 0.

This script worked for me:

UPDATE `store` SET store_id = 0 WHERE code='admin';
UPDATE `store_group` SET group_id = 0 WHERE name='Default';
UPDATE `store_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';

Hope it helps.

| improve this answer | |
  • Hello @adam,I have same issue and applied your solution but not helping this code. – akgola Jul 18 '18 at 13:17

Go to setup_module table. Delete Magento_Store entry. Now setup upgrade should do the trick.

Remember, setup upgrade command does nothing when a module is up-to-date in the setup_module table. Hence when you delete the module from the setup_module table, setup upgrade will reinstall schema and data

| improve this answer | |

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