Stuck in Maintenance Mode with EVERY update

With Nextcloud 14.0.2 and now 15.0.0 my system is set to automatically execute updates.
Because of that, every couple of days it switches to maintenance mode and gets stuck there.

So every couple of days I need to log into the shell and disable it with the occ command or by editing the config.php file.

This doesnt fix the root cause though. It isnreally annoying to be honest.
So how can I fix the system in order to automatically go back to maintenance mode off or to finally stop maintenance mode forever?

I have seen this:

But I am not sure if that is what is related to your issue. How do you do the automatically executed updates? Normally there isn’t an update every couple of days, so worst case it should only leave you in maintenance mode after a real update (once a month), that is bad enough.

I’m using NextcloudPi with nc-autoupdate and nc-autoupdate-nextcloud so that NextCloudPi and NextCloud specific updates are getting executed. So it’s probably the NextcloudPi Updates that happen more often.

Executing sudo -u www-data php updater/updater.phar results in:
Nextcloud Updater - version: v14.0.2RC2-7-g57268cb
Current version is 15.0.0
No update available.
Nothing to do.

Executing sudo -u www-data php occ upgrade results in:
Nextcloud is already latest version

So the problem remains…

there’s also not an NCP update every couple days, I would start by checking /var/log/ncp.log

Might this be a hint for the root cause?
If the server runs NC15 I’d expect the updater to be of version 15 as well.

What is the best way to bring the updater up to date?

@nachoparker: I did that, but didn’t find anything suspicious. Any advice about what to look for?

@Schmu: That caught my eye as well. And I’m asking the same question. Was not able to find any information in order to get the updater itself to a newer version.

This is really frustrating…

Hi again,

So I checked where the updater is coming from and it is actually delivered with an update via the updater :slight_smile: or via the nextcloud download site. But not with the zip archive from github.

Please download this package:

And extract the updater folder. Copy that folder (“updater”) into your nextcloud directory and adapt ownership and permissions (adapt commands to your environment):

find . -type f -print0 | xargs -0 chmod 0640
find . -type d -print0 | xargs -0 chmod 0750

HI Schmu, seems to be a dead end.
Done the whole procedure with the result of getting the version number v14.0.2RC2-7-g57268cb again. Searching the updater.phar file in the file shows that this seems to be the current version of that package.

Hi @codac

Sorry, that lead into the wrong direction.
When the check is performed every couple of days, there is probably a cronjob configured. Could you check and post the output of:
crontab -l -u www-data

When you executed these commands, was NC also sent into maintenance mode and stayed in maintenance?

Hi Schmu, no worries, I’m happy for any help with this.

The result is: */15 * * * * php -f /var/www/nextcloud/cron.php

I can’t really say as I always get the message that there is nothing to update as the system is up to date.

Strange, I expected some updater script configured as cron job. Could you check for root and your normal user as well, if there are cron jobs leading to the regular check?

I’ve checked for the root and pi user, same result.
What I acutally do is using the nc (or ncp for NextcloudPi) commands:

I have been updating through nc-update but why isn’t Nextcloud on the latest version?

nc-update only updates NextCloudPi related stuff. In order to upgrade the Nextcloud instance itself you use nc-update-nextcloud. Or better still : enable nc-autoupdate and nc-autoupdate-nextcloud so your instance > will always be automatically update to the latest stable version of NCP and NC. It is not advisable (for NCP > users) to use NC’s own update facility at present.

Sorry… need to correct my last reply:
User www-data has the mentioned cronjob. root and pi have none at all.

Well I don’t have ncp running, so I don’t know much about it. However, even with
nc-autoupdate-nextcloud I expected a cron job triggering it. Not sure where the automatism can be found instead.

I had a look at the script ncp-update-nc at but I couldn’t find any line where NC is set to maintenance.

@nachoparker can you please help here? Why is NC stuck in maintenance every time NCP checks for NC updates (when the autoupdater is activated)? It seems strange to me that it actually switches to maintenance mode, just to check for a new version and discover that there is no new version. I can’t figure it out and can’t find any lines in the code (on github master where maintenance would ever be set), sorry. I couldn’t find an issue on github for that and I guess it is not a general bug, otherwise others would have reported that already.
Thanks for your assistance. Oh and Happy new year! :slight_smile: Keep up the good work!

1 Like

I have opened an issue.

@codac you could also post the ncp.log (maybe here and on github) like nachparker suggested earlier (just saw that).

@Schmu and @nachoparker: I was not able to upload / post the nextcloud.log / ncp.log here but at github. Please find it there.

No further response so far… anyone?

from your nextcloud log

+00:00",“remoteAddr”:“”,“user”:"–",“app”:“core”,“method”:“PROPFIND”,“url”:"/remote.php/webdav",“message”:“Login failed: ‘username1’ (Remote IP: ‘’)”,“userAgent”:“Mozilla/5.0 (iOS) Nextcloud-iOS/2.22.7”,“version”:“”}

Can only see that webdav logins are failing
Your ncp.log I could not open with plain text editor
(xed has not been able to detect the character encoding. Please check that you are not trying to open a binary file.)

Best use or similar and post link here.
Has anybody else reported same issue anywhere?

The failing logins are due to a switch to 2fa. I had not set the app passwords yet.

The ncp.log you can find here:

The nextcloud.log you can find here:

There are many people complaining about getting stuck in the maintenance mode. Anyhow it seems always to be a one time situation. They all eem to be happy to drop the occ maintenance mode off command.

Just yesterday around 4p.m. MEZ my NextcloudPi went into maintenance mode again.

Thanks for posting logs.
Yes there was an ncp-update last night, during which maintenance mode would be enabled, your log shows latest update was okay and maintenance mode disabled.

Finished code integrity check
Update successful
Turned off maintenance mode

You updated using

  • nc-update-nextcloud ]
    Current Nextcloud version
    Available Nextcloud version 15.0.0

NCP “production” users should really wait for NCP Devs to push update through nc-autoupdate-nextcloud. You can expect issues if you jump ahead. But yours seems to be fine now, or are you still having issues?