Suddenly (without any changes or updates) our magento installation seems to be completely broken.
Every day we're now getting some of this errors:
- There was no 404 CMS page configured or found when accessing /index.
- The magento installer suddenly shows up when accessing /index
- No template is showing up (as shown in the picture)
- Strange redirects. When everything seems to work (no 404 cms error, no template issues) and I try to visit a product I sometimes get redirected to the home page.
Well, what I did so far is:
- flushed cache folder, flushed session folder
- truncated table core_url_rewrite
It seemed to work. After reindexing (core_url_rewrite) everything seemed broken again so I truncated again. With empty core_url_rewrite it looked all okay. But the next day it was broken again.
Well and today it's the same again but today it's also the first time where flushing cache, sessions and core_url_rewrite doesn't work anymore.
Oh and this is showing up in our nginx error log:
[error] 11773#11773: *242799 FastCGI sent in stderr: "PHP message: PHP Fatal error: Call to a member function getCode() on boolean in /htdocs/seg_posorder/stage/app/code/core/Mage/Customer/Model/Session.php on line 71" while reading response header from upstream, client: 217.24.X.X, server: www.example.com, request: "GET /index.php/customer/account/login/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.example.com", referrer: "example.com"
But our stores also seem okay:
Best Answer
After chatting with @moose I've decided to post this as an answer myself. Thanks to Nexcess for pointing @moose to my write up, and thus feeding my insatiable lust for stars on my github repository.
There is a core magento configuration cache bug which causes a "No 404 CMS Page configured" error or - in other instances - a "100 router match iteration" error. The error goes away when you flush the cache, but usually re-appears after some time.
https://github.com/convenient/magento-ce-ee-config-corruption-bug
(Edit: Further changes can be added to prevent config corruption: https://github.com/convenient/magento-ce-ee-config-corruption-bug#update-2-further-improvements)
Replication
Check out my repository above.
It has a file 100-router-script.php which should help replicate the error for you by running it in the root of your website.
The Patch
Magento have released a patch (SUPEE-4755) based on my write up.
You can grab a copy of the patch here: https://github.com/convenient/magento-ce-ee-config-corruption-bug/blob/master/PATCH_SUPEE-4755_EE_1.13.1.0_v1.sh
And for historical reasons or in case my github account ever gets deleted
If this doesn't fix your Magento instance
This patch file will solve all reasonably vanilla magento instances (anything that reinitialises the configuration cache using the defined
init
orreinit
methods).If you have any code which calls the
loadDb
function - liken98-magerun
- then you're likely to have a bad time and should probably consider refactoring your code to callreinit
orinit
onMage_Core_Model_Config
.If you still have trouble, I recommend you read my write up and
A theory on why supee 6788 makes the error worse
I've just posted this in the chat room and thought I'd pop it here for posterity.