Warning: Failed to set memory limit to 0 bytes

I recently installed AIO through containers on my server. I have a GPU on my server, so I enabled NEXTCLOUD_ENABLE_DRI_DEVICE

My server has a 16GB RAM and is running only NextCloud at the moment. In future, I’m planning to run other small apps (like adguard home). So, I assigned 8GB memory limit.

sudo docker run \
--init \
-d \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 80:80 \
--publish 8080:8080 \
--publish 8443:8443 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
--env NEXTCLOUD_DATADIR="/media/my-drive/ncdata/" \
--env NEXTCLOUD_MOUNT="/media/my-drive/" \
--mount type=tmpfs,destination=/tmp:exec \

However, when i try to docker exec on nextcloud-aio-nextcloud container, i do see an alarming warning:

6db728e81f4a:/var/www/html# sudo -u www-data php occ -V

Warning: Failed to set memory limit to 0 bytes (Current memory usage is 2097152 bytes) in Unknown on line 0
The current PHP memory limit is below the recommended value of 512MB.
Nextcloud 28.0.1 RC1

But, in my web interface I see this info:

Version: 8.1.26
Memory limit: 8 GB
Max execution time: 3600
Upload max size: 10 GB
OPcache Revalidate Frequency: 60
Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, session, PDO, pdo_sqlite, bz2, posix, readline, Reflection, standard, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, cgi-fcgi, apcu, bcmath, Phar, exif, gd, gmp, imagick, imap, intl, ldap, memcached, pcntl, pdo_pgsql, pgsql, redis, smbclient, sodium, sysvsem, zip, libsmbclient, Zend OPcache

what’s wrong with my instance?

Hi, see https://github.com/nextcloud/all-in-one#how-to-run-occ-commands


i wonder what the difference is between

docker exec -it nextcloud-aio-nextcloud /bin/bash
sudo -u www-data php occ -V


sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ -V

I don’t see the error if i use the latter :thinking:

It’s due to the environment being missing with the former (so the PHP_MEMORY_LIMIT is not provided).

See /usr/local/etc/php/conf.d/nextcloud.ini in the Docker image/container.

1 Like