Nextcloud upgrade from 23.0.5-0 to 23.0.6-0 leaves NC in Maintenance mode

I routinely keep the apps updated on my 4.4-9 errata1262 server. A couple of days ago, I got the notice that an upgrade from 23.0.5-0 to 23.0.6-0 was available. I chose to upgrade it using the UCS gui.

Everything seemed to go okay.

When I tried to access files from my phone, they were not available. When I go to the web login, I get "Maintenance Mode - his Nextcloud instance is currently in maintenance mode, which may take a while. This page will refresh itself when the instance is available again.

Contact your system administrator if this message persists or appeared unexpectedly."

How do I resolve this?

Thank you!

I’ve run into the same thing. The upgrade log shows

Exception: Database error when running migration latest for app onlyoffice

Not quite sure how to fix it. I will probably just roll back to my latest snapshot for now.

Please check the Nextclod log at the time while updating your instance.
In many cases Nextcould remains in Maintenece mode, if a manual “occ” - operation is needed f.ex. if database fiels need to be converted into a new numeric format or new fields or indices are needed.

Messages like this contain a string like occ db:convert-filecache-bigint or similar.
After running the occ command manually, you may able to disable maintenance mode.

see: Using the occ command — Nextcloud latest Administration Manual latest documentation

So I fixed this particular problem on my system by removing onlyoffice. It was needing an upgrade when I logged into Nextcloud as Admin and even running that update in Nextcloud result in a problem. Since we have only used that app a couple of times I have just left it uninstalled for now. The update ran after that with no issue. I did also run the add-missing-indices command that shows up in the on screen message after the upgrade. I don’t recall if I ever paid attention to that one before and it did need to be run on my system. HTHS

I checked the /var/log/ folder in the NextCloud Docker and find the following:
<<<<<<<<<<<<<
Disabled incompatible app: contacts
Disabled incompatible app: mail
Disabled incompatible app: user_saml
Updating [circles] …
Updated circles to 23.1.2
Updating [onlyoffice] …
Exception: Database error when running migration latest for app onlyoffice
Update failed
Maintenance mode is kept active
Resetting log level
<<<<<<<<<<<<<<<<<<<<<

It appears that I have an onlyoffice issue as well.

I uninstalled onlyoffice version 6.3.1.33via UCS web app and then ran the shell script to set the nextcloud maintenance mode ‘off’.

I restarted the server and reran the UCS web app module for application updates. No updates were found.

Now, the NextCloud web app screen says “Update needed. Please use the command line updater because automatic updating is disabled in the config.php”

When I try the command line as root : univention-app upgrade nextcloud, it appears to start the update and then throws the error: “ucr cannot be found, falling back to changing the database file directly.”

NextCloud still does not run.

Your thoughts and suggestions are much appreciated.

John

I am not that experienced with the details of nextcloud as I have only run it as an app under UCS. But I did find through some searching how to do some things on the command line.

If you want to run the nextcloud occ command from the UCS shell directly you can do it like this:

univention-app shell nextcloud sudo -u www-data /var/www/html/occ

That command is used to manage things in the shell and can be used even when nextcloud is in other than the normal operating mode. So for instance to turn off maintenance mode

univention-app shell nextcloud sudo -u www-data /var/www/html/occ maintenance:mode --off

Then to disable onlyoffice

univention-app shell nextcloud sudo -u www-data /var/www/html/occ app:disable onlyoffice

and remove onlyoffice

univention-app shell nextcloud sudo -u www-data /var/www/html/occ app:remove onlyoffice

repair installation

univention-app shell nextcloud sudo -u www-data /var/www/html/occ maintenance:repair

upgrade

univention-app shell nextcloud sudo -u www-data /var/www/html/occ upgrade

If some combination of those commands manages to get you to a successful update of the UCS app then you might want to finish up with this

univention-app shell nextcloud sudo -u www-data /var/www/html/occ db:add-missing-indices

Kevo! :grinning:

Your suggestions have NextCloud back up and running. This is such a help. I did the following:
univention-app shell nextcloud sudo -u www-data /var/www/html/occ maintenance:mode --off
univention-app shell nextcloud sudo -u www-data /var/www/html/occ app:disable onlyoffice
univention-app shell nextcloud sudo -u www-data /var/www/html/occ app:remove onlyoffice
univention-app shell nextcloud sudo -u www-data /var/www/html/occ upgrade
and
univention-app shell nextcloud sudo -u www-data /var/www/html/occ db:add-missing-indices

I will let this work for a bit before trying to reintroduce onlyoffice.

I would really like to understand what led up to this fail. If I can prevent it from happening again, that would be a lesson well learned.

Thank you, again.
John

Glad you got it running again. My suspicion about what happened is that the onlyoffice app in Nextcloud wasn’t updated consistently and at some point it got out of sync so that it could no longer be updated along with the Nextcloud update.

In the future with apps that aren’t maintained by Nextcloud I plan on checking and updating any apps that need updates before upgrading Nextcloud. Hopefully that will be a reliable solution, but I also plan on doing snapshots of my UCS VM before any updates just in case. It’s saved me more than once. :slight_smile:

Hint:
I recommend to check the Univention Update logs after updates.
You might find messages there, what to do next, if Nextcloud update runs into trouble because of changes in database or incompatible apps and the occ - commands to call, if Nextcloud will remain in maintenance mode.

just as info. I had the same problem / behavior. I then went back to the pre-update snapshot (proxmox). On the second try the problem did not occur,

Hi guys, I have same problem, I tried multiple times (going back with the vmware snapshot) but without success.

Is there anything I can do?

I’m on latest Univention 5.0-2 errata343.

Thank you!

Did you check the log after update as well as nextcloud.log in the Nextcloud data folder?

Sorry for delay, today I solved the problem thanks to this:

Mastodon