Migrated Nextcloud needs CLI update?

NethServer Version: 8.current
Module: Nextcloud

Continuing on the migration saga from NS7…

I’m running NS8 on Rocky 9 current, and have migrated Nextcloud from my NS7.9 installation, which is as up-to-date as it could be given that it’s now EOL. The migration proceeded without noted issues in the GUI of either system, so I told it to finish the migration.

But when I browse to my Nextcloud instance, I get a message saying, “Please use the command line updater because updating via browser is disabled in your config.php.”:

A little bit of searching found this post, which in combination with the nextcloud docs, suggested I should run runagent -m nextcloud1 occ upgrade

Unfortunately, that failed, with a message of Exception: Updates between multiple major versions and downgrades are unsupported. (full output below)

The NS7 system was running whatever version of Nextcloud was most current for it, but as the migration disabled it I’m not sure how to check. Apparently NS8 is more than one major version past what NS7 was using. How should I proceed here?

Full output of that command:

[root@ns8 ~]# runagent -m nextcloud1 occ upgrade
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
Setting log level to debug
Turned on maintenance mode
[nextcloud][updater][1] {"reqId":"pPQNCmZPBMYk6c2qdYNX","level":1,"time":"2024-11-22T19:07:16+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceEnabled: Turned on maintenance mode","userAgent":"--","version":"","data":{"app":"updater"}}
[nextcloud][core][0] {"reqId":"pPQNCmZPBMYk6c2qdYNX","level":0,"time":"2024-11-22T19:07:16+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"starting upgrade from  to 27.1.11.3","userAgent":"--","version":"","data":{"app":"core"}}
[nextcloud][PHP][3] {"reqId":"pPQNCmZPBMYk6c2qdYNX","level":3,"time":"2024-11-22T19:07:16+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Undefined array key 1 at /var/www/html/lib/private/Updater.php#203","userAgent":"--","version":"","data":{"app":"PHP"}}
[nextcloud][no app in context][3] {"reqId":"pPQNCmZPBMYk6c2qdYNX","level":3,"time":"2024-11-22T19:07:16+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"{\"Exception\":\"Exception\",\"Message\":\"Updates between multiple major versions and downgrades are unsupported.\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/html/lib/private/Updater.php\",\"line\":139,\"function\":\"doUpgrade\",\"class\":\"OC\\\\Updater\",\"type\":\"->\",\"args\":[\"27.1.11.3\",\"\"]},{\"file\":\"/var/www/html/core/Command/Upgrade.php\",\"line\":225,\"function\":\"upgrade\",\"class\":\"OC\\\\Updater\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/html/3rdparty/symfony/console/Command/Command.php\",\"line\":298,\"function\":\"execute\",\"class\":\"OC\\\\Core\\\\Command\\\\Upgrade\",\"type\":\"->\",\"args\":[[\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"],[\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"]]},{\"file\":\"/var/www/html/3rdparty/symfony/console/Application.php\",\"line\":1040,\"function\":\"run\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Command\\\\Command\",\"type\":\"->\",\"args\":[[\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"],[\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"]]},{\"file\":\"/var/www/html/3rdparty/symfony/console/Application.php\",\"line\":301,\"function\":\"doRunCommand\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[[\"OC\\\\Core\\\\Command\\\\Upgrade\"],[\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"],[\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"]]},{\"file\":\"/var/www/html/3rdparty/symfony/console/Application.php\",\"line\":171,\"function\":\"doRun\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[[\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"],[\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"]]},{\"file\":\"/var/www/html/lib/private/Console/Application.php\",\"line\":218,\"function\":\"run\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[[\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"],[\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"]]},{\"file\":\"/var/www/html/console.php\",\"line\":100,\"function\":\"run\",\"class\":\"OC\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/html/occ\",\"line\":11,\"args\":[\"/var/www/html/console.php\"],\"function\":\"require_once\"}],\"File\":\"/var/www/html/lib/private/Updater.php\",\"Line\":240,\"message\":\"Updates between multiple major versions and downgrades are unsupported.\",\"exception\":{},\"CustomMessage\":\"Updates between multiple major versions and downgrades are unsupported.\"}","userAgent":"--","version":""}
Exception: Updates between multiple major versions and downgrades are unsupported.
[nextcloud][updater][3] {"reqId":"pPQNCmZPBMYk6c2qdYNX","level":3,"time":"2024-11-22T19:07:16+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::failure: Exception: Updates between multiple major versions and downgrades are unsupported.","userAgent":"--","version":"","data":{"app":"updater"}}
Update failed
[nextcloud][updater][3] {"reqId":"pPQNCmZPBMYk6c2qdYNX","level":3,"time":"2024-11-22T19:07:16+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"--","version":"","data":{"app":"updater"}}
Maintenance mode is kept active
[nextcloud][updater][1] {"reqId":"pPQNCmZPBMYk6c2qdYNX","level":1,"time":"2024-11-22T19:07:16+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"","data":{"app":"updater"}}
Resetting log level
[nextcloud][updater][1] {"reqId":"pPQNCmZPBMYk6c2qdYNX","level":1,"time":"2024-11-22T19:07:16+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","version":"","data":{"app":"updater"}}
[root@ns8 ~]#

adapting 2nd method (b) from wiki guide to ns8 most probably will work.

EDIT:
If version of nextcloud on ns7 was the latest available update, the problem should not have happened (IIUC):

Unless that only applies to nextcloud upgrades once already on ns8:

I wonder why “from” is empty?

I suspect this is related–backup of the Nextcloud app (only) is failing:
image

Here’s what I’m seeing in the system logs:

2024-11-22T23:10:23-05:00 [1:nextcloud1:backup2] Dirs:         6693 new,     0 changed,     0 unmodified
2024-11-22T23:10:23-05:00 [1:nextcloud1:backup2] snapshot a9ef37b1 saved
2024-11-22T23:10:23-05:00 [1:nextcloud1:backup2] processed 113828 files, 253.468 GiB in 10:01
2024-11-22T23:10:23-05:00 [1:nextcloud1:backup2] Added to the repository: 588.194 MiB (204.697 MiB stored)
2024-11-22T23:10:23-05:00 [1:nextcloud1:backup2] Files:       113828 new,     0 changed,     0 unmodified
2024-11-22T23:10:23-05:00 [1:nextcloud1:backup2] restic forget --prune --keep-last=5
2024-11-22T23:10:24-05:00 [1:nextcloud1:backup2] repo already locked, waiting up to 0s for the lock
2024-11-22T23:10:25-05:00 [1:nextcloud1:backup2] storage ID c3f432bf
2024-11-22T23:10:25-05:00 [1:nextcloud1:backup2] the `unlock` command can be used to remove stale locks
2024-11-22T23:10:25-05:00 [1:nextcloud1:backup2] lock was created at 2024-11-22 16:07:00 (12h3m24.158744086s ago)
2024-11-22T23:10:25-05:00 [1:nextcloud1:backup2] unable to create lock in backend: repository is already locked by PID 1 on ns8.familybrown.org by root (UID 0, GID 0)
2024-11-22T23:10:25-05:00 [1:nextcloud1:backup2] restic stats --json
2024-11-22T23:10:32-05:00 [1:nextcloud1:backup2] 2024/11/23 04:10:32 ERROR : f88154ae-2520-4876-8295-6052234af97b.json: Failed to copy: failed to prepare upload: AccessDenied: Access Denied.
2024-11-22T23:10:32-05:00 [1:nextcloud1:backup2] 2024/11/23 04:10:32 Failed to rcat: failed to prepare upload: AccessDenied: Access Denied.
2024-11-22T23:10:32-05:00 [1:nextcloud1:backup2] 	status code: 403, request id: 180A7D88A5A0EE30, host id:
2024-11-22T23:10:32-05:00 [1:nextcloud1:backup2] 2024/11/23 04:10:32 ERROR : f88154ae-2520-4876-8295-6052234af97b.json: Post request rcat error: failed to prepare upload: AccessDenied: Access Denied.
2024-11-22T23:10:32-05:00 [1:nextcloud1:systemd] backup2.service: Main process exited, code=exited, status=1/FAILURE
2024-11-22T23:10:32-05:00 [1:nextcloud1:systemd] backup2.service: Failed with result 'exit-code'.
2024-11-22T23:10:32-05:00 [1:nextcloud1:systemd] backup2.service: Consumed 7.360s CPU time.

NS7 definitely was up-to-date. And 27.1.11 is what’s being reported in NS8 as well:

[root@ns8 ~]# runagent -m nextcloud1 occ --version
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
Nextcloud 27.1.11
[root@ns8 ~]#

I wonder if the issue is that NS7 was running 27.1.11.3?

[root@neth config]# grep version config.php
  'version' => '27.1.11.3',

I do see that the software center reports an available update for Nextcloud:
image

…but I’m kind of reluctant to try to upgrade it when it isn’t currently working.