Server issue Avatar upload failed: no error message

Karelke

Well-known 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.webp

(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.webp
 
Set avatar file size to unlimited

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.webp
 
Last edited:
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.
 
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.

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.
 
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.
 
Top Bottom