发现什么导致了可怕的“网站遇到了一个意想不到的错误。请稍后再试。”消息

时间:2022-03-15 15:36:00


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

当drupal进行6 - 7升级时,我得到了一个不太有用的信息。请稍后再试。例)/管理/配置

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.

谢谢。

4 个解决方案

#1


15  

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

如果dlog/watchdog和php错误日志不起作用,请尝试以下操作:

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

包括/错误。评论行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

非常类似,您将var_export($error,true)放在错误末尾

#2


11  

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.

通过清除/admin/reports/dblog上的日志,然后重新加载损坏的页面,我可以很容易地在重新检查日志时识别出违规模块。

Site is working fine now : )

网站现在运行良好:)

#3


3  

You definitely should be disabling all contrib modules to perform the upgrade. Then enable them a few at a time after they have been replaced with the D7 version. When replacing the module, be sure to clean out the entire module directory, just in case some old files remain.

您肯定应该禁用所有的设计模块来执行升级。然后在用D7版本替换后,每次启用一些。在替换模块时,一定要清除整个模块目录,以防某些旧文件仍然存在。

This should help narrow down the problem and be sure to check the php error log in case you find something there. (Although that is usually in the case of the White Screen Of Death.)

这将有助于缩小问题的范围,并确保在发现错误时检查php错误日志。(虽然在死亡的白色屏幕上通常是这样。)

#4


0  

As gyozo mentioned if you are not able to log into the site, then it might be difficult to debug.

正如gyozo所提到的,如果您无法登录到站点,那么可能很难调试。

Then probably you could try

也许你可以试试

  1. Log into database and run delete from watchdog;
  2. 登录数据库并从看门狗中删除;
  3. Refresh the page
  4. 刷新页面
  5. Then execute the database query select variables from watchdog;
  6. 然后从监视器执行数据库查询选择变量;
  7. Look out for the text near message
  8. 注意短信旁边的文字

#1


15  

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

如果dlog/watchdog和php错误日志不起作用,请尝试以下操作:

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

包括/错误。评论行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

非常类似,您将var_export($error,true)放在错误末尾

#2


11  

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.

通过清除/admin/reports/dblog上的日志,然后重新加载损坏的页面,我可以很容易地在重新检查日志时识别出违规模块。

Site is working fine now : )

网站现在运行良好:)

#3


3  

You definitely should be disabling all contrib modules to perform the upgrade. Then enable them a few at a time after they have been replaced with the D7 version. When replacing the module, be sure to clean out the entire module directory, just in case some old files remain.

您肯定应该禁用所有的设计模块来执行升级。然后在用D7版本替换后,每次启用一些。在替换模块时,一定要清除整个模块目录,以防某些旧文件仍然存在。

This should help narrow down the problem and be sure to check the php error log in case you find something there. (Although that is usually in the case of the White Screen Of Death.)

这将有助于缩小问题的范围,并确保在发现错误时检查php错误日志。(虽然在死亡的白色屏幕上通常是这样。)

#4


0  

As gyozo mentioned if you are not able to log into the site, then it might be difficult to debug.

正如gyozo所提到的,如果您无法登录到站点,那么可能很难调试。

Then probably you could try

也许你可以试试

  1. Log into database and run delete from watchdog;
  2. 登录数据库并从看门狗中删除;
  3. Refresh the page
  4. 刷新页面
  5. Then execute the database query select variables from watchdog;
  6. 然后从监视器执行数据库查询选择变量;
  7. Look out for the text near message
  8. 注意短信旁边的文字