1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Always getting generic instead of specific error

Discussion in 'Troubleshooting and Problems' started by Thomas.B, Jul 1, 2016.

  1. Thomas.B

    Thomas.B 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..
  2. James

    James Well-Known Member

    Check your error logs in the Admin CP for specific error messages, this should have them.
  3. Mike

    Mike XenForo Developer Staff Member

    That probably indicates a different error, though it's not 100% certain. Are there any error logs in the control panel?
  4. Thomas.B

    Thomas.B Well-Known Member

    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}
  5. Mike

    Mike XenForo Developer Staff Member

    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.
    Thomas.B likes this.
  6. Thomas.B

    Thomas.B Well-Known Member

    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..
  7. Mike

    Mike XenForo Developer Staff Member

    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.
  8. Thomas.B

    Thomas.B Well-Known Member

    Yeah, you're probably right. That would be at least a good explanation..

Share This Page