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

Server Issue Avatar upload failed: no error message

Discussion in 'Resolved Bug Reports' started by Karelke, Aug 22, 2014.

  1. Karelke

    Karelke Active Member

    1) Set avatar file size to unlimited (through user group permissions).
    2) Being unlimited, I expect I can upload any size.
    3) Uploading 1 MB works fine, uploading 3 MB fails.
    4) I expect to see an error message, instead the ajax loader stops and nothing else happens.

    So I looked in the Firebug console and noticed the following error:

    Screenshot from 2014-08-22 12:31:13.png

    (it's Dutch for "file size is too large to process")

    You can reproduce this behavior on xenforo.com by uploading a 10 MB file.

    I presume the script hit a PHP file limit. It would be nice to show a message popup instead, similar like this one:

    Screenshot from 2014-08-22 12:35:18.png
  2. Karelke

    Karelke Active Member

    The same happens when setting an avatar size limit. If the post-processed file is larger than the permission setting, the ajax loader stops and an error message is visible in the Firebug console.

    Screenshot from 2014-08-22 14:01:55.png
    Last edited: Aug 22, 2014
  3. Mike

    Mike XenForo Developer Staff Member

    The specific behavior you're reporting here is an issue with your server configuration -- these are exceptions that are printed back to the browser. Usage of some combinations/versions of PHP extensions interferes with this. Notably, opcode caches not designed for the PHP version in use or other outdated debugging-related extensions.

    The behavior you see on XenForo.com, for example, is a different issue. It's down to how PHP behaves when you send data longer than post_max_size (regardless of the upload_max_size value). PHP truncates the response, which causes various oddities to happen. In this case, returning HTML content instead of JSON. The error is about the missing CSRF token so it's not actually particularly useful. This is a value that can only be changed before PHP starts up. I'm not sure what can be done in this case, though I will look.
  4. Karelke

    Karelke Active Member

    We're using PHP 5.5.16 with the built-in OPcache extension, and APCu (4.0.6). I will disable both extensions to give it a try.
  5. Karelke

    Karelke Active Member

    Disabling OPcache seems to work, I'm now getting the error popup. Disabling APCu doesn't make any difference so it really comes down to OPcache.
  6. Karelke

    Karelke Active Member

    I came across the following bug report:


    Setting opcache.optimization_level to 0 seems to resolve the problem. I'm not sure yet how this setting will impact performance.

Share This Page