Nextcloud : can not update nor exit maintenance mode

Hi all,

Lately I updated Dietpi to v7.8.2 . Nextcloud goes to maintenance mode for upgrading

After pressing start update it gives error

Then it goes to maintenance mode . I tried this command

occ upgrade

I it’s done without error but nothing changes . I tried this command :

root@DietPi:/# ncc maintenance:mode --off
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Maintenance mode disabled

Same thing nothing happen . Can anyone help me please ?

use following to upgrade NextCloud on command line

sudo -u www-data php /var/www/nextcloud/updater/updater.phar

Thank you Joulinar for replaying :smiley:

root@DietPi:/# sudo -u www-data php /var/www/nextcloud/updater/updater.phar
Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4

Current version is 21.0.7.

Update to Nextcloud 21.0.7 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-21.0.7.zip
Open changelog β†—

Steps that will be executed:
[βœ”] Check for expected files
[βœ”] Check for write permissions
[βœ”] Create backup
[βœ”] Downloading
[βœ”] Verify integrity
[βœ”] Extracting
[βœ”] Enable maintenance mode
[βœ”] Replace entry points
[βœ”] Delete old files
[βœ”] Move new files in place
[βœ”] Done

Continue update? [y/N] y

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[βœ”] Check for expected files
[βœ”] Check for write permissions
[βœ”] Create backup
[βœ”] Downloading
[βœ”] Verify integrity
[βœ”] Extracting
[βœ”] Enable maintenance mode
[βœ”] Replace entry points
[βœ”] Delete old files
[βœ”] Move new files in place
[βœ”] Done

Update of code successful.

Should the "occ upgrade" command be executed? [Y/n] y
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
2021-11-26T13:50:05+00:00 Setting log level to debug
2021-11-26T13:50:05+00:00 Turned on maintenance mode
2021-11-26T13:50:05+00:00 Repair step: Repair MySQL collation
2021-11-26T13:50:05+00:00 Repair info: All tables already have the correct collation -> nothing to do
2021-11-26T13:50:05+00:00 Repair step: Repair SQLite autoincrement
2021-11-26T13:50:05+00:00 Repair step: Copy data from accounts table when migrating from ownCloud
2021-11-26T13:50:05+00:00 Repair step: Drop account terms table when migrating from ownCloud
2021-11-26T13:50:05+00:00 Updating database schema
2021-11-26T13:50:05+00:00 Updated database
2021-11-26T13:50:05+00:00 Updating <duplicatefinder> ...
2021-11-26T13:50:05+00:00 Repair step: duplicatefinder: Repair FileInfo objects
2021-11-26T13:50:05+00:00 Repair info: Recalculating Path Hashes
2021-11-26T13:50:05+00:00 duplicatefinder: Repair FileInfo objects
2021-11-26T13:50:05+00:00 
2021-11-26T13:50:05+00:00  Starting ...
    0/0 [>-]   0%2021-11-26T13:50:05+00:00 
2021-11-26T13:50:05+00:00 Repair info: Clearing duplicated records
PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /var/www/nextcloud/apps/duplicatefinder/lib/Db/EEntity.php on line 44
PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /var/www/nextcloud/lib/private/Log/ErrorHandler.php on line 66

Keep maintenance mode active? [y/N] n
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Maintenance mode disabled

Maintenance mode is disabled

but still same problem :frowning:

are you able to access web site?

Yes but it shows the same page in the first post . I can not access my files .

hm not sure what the issue could be. Strange is that your system is recognising an update but it is the same version as installed

Current version is 21.0.7.

Update to Nextcloud 21.0.7

MichaIng
maybe you would have an idea

Thank you Joulinar . I was able to solve the problem :smiley:

I just went to " /var/www/nextcloud/apps" and delete folder " duplicatefinder " , restart the services and update . And It works !

Thank you gain :slight_smile:

1 Like

ah not sure why I have overlooked it before. Indeed an issue with duplicatefinder as it tried to allocate more memory then allowed.

2021-11-26T13:50:05+00:00 duplicatefinder: Repair FileInfo objects
2021-11-26T13:50:05+00:00 
2021-11-26T13:50:05+00:00  Starting ...
    0/0 [>-]   0%2021-11-26T13:50:05+00:00 
2021-11-26T13:50:05+00:00 Repair info: Clearing duplicated records
PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /var/www/nextcloud/apps/duplicatefinder/lib/Db/EEntity.php on line 44
PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /var/www/nextcloud/lib/private/Log/ErrorHandler.php on line 66

For the future, you can increase the maximum allowed memory allocation (adjust the PHP version string in case):

echo -e '; Personal PHP overrides\n; priority=99\nmemory_limit=1G' > /etc/php/7.3/mods-available/custom.ini
phpenmod custom

However, that an app requires that much for an upgrade is indeed unexpected. Nextcloud recommends 512 MiB, so this is what we apply on install (the PHP default is 128 MiB). Probably something to report to the app maintainer, to allow using it as well on devices with less RAM available.