Problem: Nextcloud update needed and cannot be used

Problem

Nextcloud cannot be used, because you get the message update needed
Screenshot from 2023-04-03 10-50-04

Check the previous version on your system with
univention-app info

UCS: 5.0-3 errata622
Installed: mailserver=12.0 office365=5.5 openproject=12.5.1 oxseforucs=7.10.6-ucs3 radius=5.0 relution=5.15.1 samba4=4.16 self-service-backend=5.0 4.4/nextcloud=24.0.7-1 4.4/rocketchat=3.18.2
Upgradable:

For an app update from nextcloud, if you need that use the following commands to update the list of apps
univention-app update
now you can sue
univention-app upgrade nextcloud

Nextcloud is on the latest version, but you get still the screen that update needed

Solution

For Nextcloud there are 2 config.php files, in which version numbers for the app are entered, these should be checked.

/var/lib/univention-appcenter/apps/nextcloud/data/integration/config/config.php

Screenshot from 2023-04-03 11-54-12

the next one is in the docker container from nextcloud

univention-app shell nextcloud
apt-get install nano
nano /var/www/html/config/config.php

Screenshot from 2023-04-03 11-52-26

After you check or edit the version in the config.php files with the real installed version, you have to do the following steps

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

Optional

Maybe you have to re-join the system, because the join-status from nextcloud is unsuccessfully.
You could check the join-status with:
univention-check-join-status

And re-join the system with:
univention-run-join-scripts

Mastodon