Thanks. This saved me after my upgrade from 20.0.8 to 21.0.1
After the upgrade any command I executed or the scheduled cron job Nextcloud runs was consuming all memory and swap on the server. i couldn’t even put the server in maintenance mode.
I was missing apc.enable_cli=1 in /etc/php/7.4/cli/conf.d/20-apcu.ini although I had APCu enabled in my config.php
I put this in and then restarted apache.
Now I can put the server in maintenance and look at the other issues.
System:
Vmware VM with CentOS 8
PHP 7.3
apache 2.4
Problem:
Upgrade from 20.0.8 to 21.0.1 did not work
Detail:
sudo -u apache php /var/www/nextcloud/updater/updater.phar
worked until:
Should the “occ upgrade” command be executed? [Y/n] Y
then:
PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php on line 133
The same with any other occ command. (which worked before the interrupted upgrade)
The above proposed work arounds like -d memory_limit=512M or -1 did not work for me.
Reason:
in nextclouds config.php where set:
‘debug’ => ‘true’,
‘loglevel’ => 0,
Solution
just set these variables to:
‘debug’ => ‘false’,
‘loglevel’ => 2,
Run “sudo -u apache php /var/www/nextcloud/occ upgrade” again.
Not sure if it’s been said already or not, but what worked for me was commenting out the memcache settings in the config.php file, running the command, then uncommenting it.
We had a similar problem. The solution we found was to remove the APCu line from config.php and then run the upgrade, but it looks as though updating the php.ini for php 7.4 would work just as well. That’s what we did afterwards, once we worked out what the problem was. The correct way is, I suspect, to put something in config.d, but we just edited config.ini directly — both for the cli and for the apache2 — adding apc.enable_cli=1 . This is mentioned in the Nextcloud manual but it took us a while to work out that it was the source of our woes.
I have just encountered the same problem after upgrading to 21. I’m not stuck in maitenance mode, but cron always runs out of memory. For me also commenting out memcache.local' => '\\OC\\Memcache\\APCu', from /var/www/nextcloud/config/config.php, letting the cron job run, and then uncommenting it again seems to have resolved the problem.
EDIT: actually uncommenting again brings the problem back