2

 '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?

closed as off-topic by sv3n, Manoj Deswal, liyakat, Prince Patel, Amit Bera Oct 17 '17 at 19:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – sv3n, Manoj Deswal, liyakat, Prince Patel, Amit Bera
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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
6

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:

SET FOREIGN_KEY_CHECKS=0;
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';
SET FOREIGN_KEY_CHECKS=1;

Hope it helps.

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

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

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