Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

finding out what is causing dreaded "The website encountered an unexpected error. Please try again later." message


while doing a drupal 6 to 7 upgrade I am getting the not so helpful message "The website encountered an unexpected error. Please try again later." everytime I go to certain pages. ex) /admin/config

What is the best way to find out what is causing the fatal error so that I can fix it?

All I can think of right now is to start disabling contributed modules until that page works or looking through the logs.

Thanks.

like image 320
brian_d Avatar asked Jan 19 '11 16:01

brian_d


2 Answers

If dlog/watchdog and php error log aren't working, try this:

go on /includes/error.inc comment line line 245

print theme('maintenance_page', array('content' => t('The website encountered an unexpected error. Please try again later.')));

and put this

print theme('maintenance_page', array('content' => t('The website encountered an unexpected error. Please try again later.'.$fatal.' '.var_export($error,true))));

Very similar, you put var_export($error,true)) at end of error

like image 97
Stefano Caravana Avatar answered Nov 15 '22 13:11

Stefano Caravana


By clearing the logs at /admin/reports/dblog then reloading the broken page I easily could identify the offending module when I rechecked the log.

Site is working fine now : )

like image 11
brian_d Avatar answered Nov 15 '22 12:11

brian_d