I have been trying to fix this issue for the past 4 days and but I am not able to get to the root cause of the issue.
Magento version: 1.9.3.2. I have also run system requirements for Magento tool and everything passed.
The Issue: Whenever I edit existing product or add a new product, the product view page of the particular product starts throwing 404 not found error in blue Magento default error page.
The only error I could find in error log:
2017-04-20T10:14:37+00:00 ERR (3):
exception 'Mage_Core_Model_Store_Exception' in /home/magestore/public_html/app/code/core/Mage/Core/Model/App.php:1377
Stack trace:
#0 /home/magestore/public_html/app/code/core/Mage/Core/Model/App.php(861): Mage_Core_Model_App->throwStoreException()
#1 /home/magestore/public_html/app/design/frontend/default/theme547/template/catalog/product/view/addtocart.phtml(37): Mage_Core_Model_App->getStore(5)
#2 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/magestore/...')
#3 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#4 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#5 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template->_toHtml()
#6 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(641): Mage_Core_Block_Abstract->toHtml()
#7 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('product.info.ad...', true)
#8 /home/magestore/public_html/app/design/frontend/base/default/template/catalog/product/view/options/wrapper/bottom.phtml(28): Mage_Core_Block_Abstract->getChildHtml('', true, true)
#9 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/magestore/...')
#10 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')
#11 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#12 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template->_toHtml()
#13 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(641): Mage_Core_Block_Abstract->toHtml()
#14 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('product.info.op...', true)
#15 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(605): Mage_Core_Block_Abstract->getChildHtml('', true, true)
#16 /home/magestore/public_html/app/design/frontend/default/theme547/template/catalog/product/view.phtml(220): Mage_Core_Block_Abstract->getChildChildHtml('container2', '', true, true)
#17 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/magestore/...')
#18 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#19 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#20 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template->_toHtml()
#21 /home/magestore/public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#22 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Text_List->_toHtml()
#23 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(641): Mage_Core_Block_Abstract->toHtml()
#24 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(585): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#25 /home/magestore/public_html/app/design/frontend/default/theme547/template/page/2columns-right.phtml(52): Mage_Core_Block_Abstract->getChildHtml('content')
#26 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/magestore/...')
#27 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#28 /home/magestore/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#29 /home/magestore/public_html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template->_toHtml()
#30 /home/magestore/public_html/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#31 /home/magestore/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#32 /home/magestore/public_html/app/code/core/Mage/Catalog/Helper/Product/View.php(147): Mage_Core_Controller_Varien_Action->renderLayout()
#33 /home/magestore/public_html/app/code/core/Mage/Catalog/controllers/ProductController.php(132): Mage_Catalog_Helper_Product_View->prepareAndRender(622, Object(Mage_Catalog_ProductController), Object(Varien_Object))
#34 /home/magestore/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_ProductController->viewAction()
#35 /home/magestore/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view')
#36 /home/magestore/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#37 /home/magestore/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#38 /home/magestore/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#39 /home/magestore/public_html/index.php(83): Mage::run('', 'store')
#40 {main}
What I have tried so far:
- Tried Reindexing all the data.
- Try to repair database using Magento database repair tool (Could not find any issue)