0

As I'm working on a D7 site, I'll occasionally hit a database-related bug in my code. When this happens, I get thrown to a version of my site's maintenance page; the error information doesn't show up on the page, but just in Watchdog. This makes sense for a production site, but it's a pain during development. Is there any way to turn this behavior off, so that the error messages show up on the page I'm working on? Thanks!

4 Answers 4

2

If you have a serious / fatal database error, you're probably not seeing the 'maintenance page' but the db_offline page which usually displays errors direct to screen. What kinds of database errors are you experiencing?

Assuming your site is not in maintenance mode, few things you can check and set:

  • Check the settings under admin/config/development/logging and make sure you have it set to display 'all messages'
  • Make sure you have php set to display errors -- you can add the following in your settings.php file to increase your error_reporting level:

error_reporting(-1);
$conf['error_level'] = 2;
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
0

We utilise static error pages, to which the reverse proxy in front of drupal (varnish) serves on behalf of drupal whenever a

  • error 403
  • error 404
  • error 5xx

error occurs. This seems to solve the problem very elegantly

1
  • Thanks; I think the first response is more on point re the db_offline matter.
    – Jim Miller
    Commented Apr 5, 2012 at 1:08
0

Install Xdebug to get a full stack traces if you hit a serios (PHP) problem.

Check http://drupal.org/node/158043 if you get an entierly blank page.

1
  • Thanks, but it's not that deep -- see above.
    – Jim Miller
    Commented Apr 5, 2012 at 1:08
0

My issue was that everytime I logged in, it would hit me to the maintenace page, but never showed an error.

In my case, I had pending database updates I didn't do with file_entity. I had to see the errors initially by adding this to settings.php at the bottom:

error_reporting(-1);
$conf['error_level'] = 2;
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

I then saw the errors that pointed out that it couldn't find the file_entity table. If its not there, that means it was never created and that means an update db didnt happen. I went and did a 'drush updb' and resolved this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.