New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ErrorHandler - Nesting level too deep - recursive dependency #2499
Comments
Replying to peterb: I'm using PHP 5.1.6 and just started getting this problem with my upgrade to Piwik 1.5 from 1.4. Using XDebug, I tracked it down to a problem with Zend_Session. It's failing to write sessions to the database table, possibly because the database handle is no longer available when Zend_Session::writeClose() is called in the destructor of Zend_Session_SaveHandler_DbTable (I'm not 100% certain.) At any rate, I changed the file core/Session.php, adding:
...after the line:
...and it now seems to work for me (no more nesting level errors, and I can also log into Piwik again.) But I haven't tested it on any other version of PHP. |
ferment, could you please tell us, what a var_dump($bt) injected into the file core/ErrorHandler.php (directly before, after or instead of the line "//array_shift($bt);" echos? I think we would be a step further then, because there is somehow a recursion in that context, i suppose. |
On my side, the adding of register_shutdown_function doesn't work. I have Piwik running with cronjobs and the error is only coming in the cronjob via email. Login into the Piwik web webinterface works without problems.
|
Removing the line 36 brings out the following error:
|
Attachment: var_dump($bt) from core/ErrorHandler.php |
Replying to peterb:
Sure. I've attached a copy of the dump to the thread. |
Replying to peterb: I think what might be happening is that var_export() is getting stuck on a circular reference in one of the $bt args. I ran across a forum discussion about this while searching: http://forum.kohanaframework.org/discussion/1631/var_dump-print_r-var_export/p1 |
Attachment: Thanks for the dump, ferment. The "Nesting level too deep"-Problem has nothing to do with other classes of piwik. It is a problem when one of the other classes throw an error, and contain a reference to itself (e.g. method chaining, &$object definition, etc.). This is often used within frameworks. Since var_export is not able to limit the depth of nesting, I propose the following patch for the ErrorHandler. |
Anthon, do we need to store executable PHP code in the logger (to reuse it somewhere for example), or would this patch make sense? |
Attachment: Applying this Patch doesn't work for me komplete, now i got many errors, see attachment. |
@GoSnA: yes, that's correct. As I stated, this is not related to the error that triggers the ErrorHandler. Now the Errors are displayed / handled correctly and we can track down the real root of the error(s). |
Thanks Peter. I'll have to look at the preg_replace, but this evidently works better than var_export. We should fix the Notices being emitted too. |
GoSnA, this is strange - please make sure, all piwik files have been correctly updated to the newest version. |
Could this somehow be linked to #2491 ? |
I strongly suggest to release 1.6 ASAP or at least 1.5.1 with this patch applied... My piwik was also broken and I fixed it by uploading the latest errorhandler.php. |
See reportings in http://forum.piwik.org/read.php?5,77659 and http://forum.piwik.org/read.php?5,78118.
Reason for the error seems to be the use of var_export in connection with debug_backtrace, see http://bugs.php.net/bug.php?id=30471 (bugs.php.net down atm)
PHP 5.2
Other configurations affected, see below
The text was updated successfully, but these errors were encountered: