Magento – No such entity with id = 0 for CategoryRepository

categorymagento2magento2.2.2

I am new to magento2. Have worked enough on magento 1 but this is my first project with magento 2.2 and i ran into issue.

I have magento 2.2 setup and installed template monster theme. Everything was working fine. Then i started adding content of my own and created few categories. Later i realize i didn't want 1 root category which i created. so i deleted it and then i started getting this error on front side. Back-end is working perfect.

Here is a full list of errors i am getting.

http://prntscr.com/ie23qk

I already tried disabling theme and extensions. None of them work. Basically magento is looking for category id 0 which is not there as it always start with 1 in db. I am not sure how to solve or dont know where to see.

Any guidance will be helpful.

Best Answer

I check all database table for wrong entry somewhere and found that in store group table default root category was set to 0. I am not sure how it happened but i think when i deleted one of the root category from the backend, it must changed in store group table or something else. i change it to 1 and it solved the issue. So posting here answer.

Thanks.

Related Topic