XF 1.5 Always getting generic instead of specific error


Well-known member
I've just noticed the following on my local dev XF 1.5 installation: when I try to submit a form with an error it always shows the generic message „An unexpected error occurred. Please try again later.“ instead of e.g. „Please enter a valid title“ (for non-admin users with disabled debug mode). The same also happens on a clean installation of the latest 1.4 release. I really wonder what the problem could be..
That probably indicates a different error, though it's not 100% certain. Are there any error logs in the control panel?
The specific error(s) including a stack trace are shown if debug mode is enabled and are also logged in the server log. For example:

XenForo_Exception: Please enter a valid message. - library/XenForo/DataWriter.php:1359
Generated By: tester1, Today at 10:38 AM

Stack Trace

#0 /var/www/html/xenforo150/library/XenForo/DataWriter.php(1401): XenForo_DataWriter->_haveErrorsPreventSave()
#1 /var/www/html/xenforo150/library/XenForo/ControllerPublic/Forum.php(828): XenForo_DataWriter->save()
#2 /var/www/html/xenforo150/library/XenForo/FrontController.php(351): XenForo_ControllerPublic_Forum->actionAddThread()
#3 /var/www/html/xenforo150/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#4 /var/www/html/xenforo150/index.php(13): XenForo_FrontController->run()
#5 {main}
This would indicate that you have a broken PHP configuration. More specifically, you have some PHP extensions that aren't compatible with one other or a bad PHP optimizer configuration (optimization should generally be off).

I'd recommend running PHP 5.6 or 7 with the built in opcache and no optimizer extensions.
Well, I actually didn't install any optimizer, just the regular PHP5 package (5.5.9) that is available in the Ubuntu 14.04 repos. And apart from that only Xdebug and cURL. However, it seems to work now after disabling OPcache. So as I don't think that I need this for my dev system I consider this issue as solved. But if anyone has an idea what could cause this behaviour I'd be still interested..
It's quite likely to be linked to a combination of xdebug and opcache. They're both extensions that do pretty deep inspections of the PHP opcodes and thus can trick code to run incorrectly.
Top Bottom