Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291721

Error on bootstrap initialisation returning HTTP 200

$
0
0

Hi guys !

I went into some trouble on a production environment with Drupal error handling. My website is connected to a Redis server using Predis but it's not really the cause of my problem, it just set the environment for the error to occur.

When something goes wrong during bootstrap instanciation ( an exception is thrown ), Drupal logs it and tries to go on after that. If an error occurs during error logging, then the Drupal exception handler catches the additional exception and print it if applicable, or just does nothing.

But this leads to some problems, since the "display if applicable" uses a variable_get. In my particular case, variable_get calls Redis to get variables from cache, and since my redis server was unavailable ( causing the first exception to occur ), an additional exception was thrown while handling the first one. So Drupal simply printed my additional exception, returning a HTTP code 200, and my varnish did his work, caching the homepage: "An additional uncaught exception ..." ...

Si I managed to export a little patch to use php configuration ( display_errors ini variable ) on error management ( to choose if errors must be displayed or not ), and added a "throw" when error should not be displayed so Apache can return a 500 error code and log the exception on his own logs.

Not sure that it will help "many" but we never know !


Viewing all articles
Browse latest Browse all 291721

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>