Logs flooded with: Invalid "upload_max_filesize" setting. Invalid quantity "16G": value is out of range, using overflow result for backwards compatibility at Unknown#0

Nextcloud version: Nextcloud Hub 8 (29.0.2)
Operating system and version: Raspbian GNU/Linux 10 (buster)
Apache version: Apache/2.4.59
PHP version: 8.2.20

I have a Raspberry Pi 4 with Nextcloud installed on it via snap. It has been running without issues for a long time, but recently I’ve checked the logs and they are flooded with:

Invalid "upload_max_filesize" setting. Invalid quantity "16G": value is out of range, using overflow result for backwards compatibility at Unknown#0

Example error logs, basically for each request:

{"reqId":"cexispG7Oc99nVBLe5rQ","level":3,"time":"2024-06-24T08:53:41+00:00","remoteAddr":"209.38.136.56","user":"--","app":"PHP","method":"GET","url":"/","message":"Invalid \"upload_max_filesize\" setting. Invalid quantity \"16G\": value is out of range, using overflow result for backwards compatibility at Unknown#0","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","version":"29.0.2.2","data":{"app":"PHP"}}
{"reqId":"KGPZ3BsP99A4JBNM7ZX3","level":3,"time":"2024-06-24T10:21:24+00:00","remoteAddr":"redacted_ip","user":"redacted_user","app":"PHP","method":"GET","url":"/index.php/204","message":"Invalid \"upload_max_filesize\" setting. Invalid quantity \"16G\": value is out of range, using overflow result for backwards compatibility at Unknown#0","userAgent":"Mozilla/5.0 (Windows) mirall/3.13.0stable-Win64 (build 20240423) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"29.0.2.2","data":{"app":"PHP"}}

Nextcloud snap configures upload_max_filesize and post_max_size in:

config/php/php-fpm.d/www.conf:php_value[upload_max_filesize] = 16G
config/php/php-fpm.d/www.conf:php_value[post_max_size] = 16G

And according to phpinfo that I run from within the Nextcloud the values are set successfully to 16G. So I have no clue why these errors are logged. Moreover, these PHP settings are not user configurable in the Nextcloud snap. I have tried to open an issue for it, but it was closed because they only support Ubuntu and they think it’s not a snap issue.

I don’t see how these errors could be a result of using snaps on Raspbian, and I haven’t changed anything in the config lately except for adjusting the PHP memory limit, I’ve tried setting it to -1, 1024M and 128M, but I didn’t see any effect of the errors. Also there aren’t many user configurable PHP options in the Nextcloud snap.

The only recent change that comes to my mind is that I have replaced the Raspberry Pi 4, I used to have a 4GB version, and now I have a 8GB version. (And that’s why I had increased the memory limit.)

I’d appreciate any help understanding why these errors are logged and how to get rid of them.

Are you by chance running 32-bit rather than 64-bit on your Pi 4?

I believe that’s the underlying cause.

PHP’s config parser has overflow detection built-in to prevent insane values that won’t work on a particular host.

The Pi 4 supports 64 bit, but if it’s an older OS install it may 32-bit until you reinstall the OS.

Yes, I have 32-bit Raspbian installed there. (I know it’s getting out of support in literally 2 days, I need to reinstall it at some point).

Is 16G such an insane value though? It’s been a while since I used PHP, but I guess upload_max_filesize should be only limited by the maximum size of the file that filesystem supports.

You need to reduce the value to get rid of the message. On a 32-bit OS the maximum value of the parameter should be 2GB (2147483647 bytes).

Thanks for your help! I guess I’ll have to reinstall the OS to 64 bit or stop using snaps. Because I use Nextcloud via snap and I cannot change this setting there.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.