Upgrade failed, downgrade blocked, once more I'm stuck

I’m using: “ghcr.io/linuxserver/nextcloud”
I came from: “22.2.3”
and started a docker in version “23.0.0” by mistake
Reverted back to “22.2.3” in config.php and docker, but no joy

/* Ignore that part, it was caused by mapping the old /etc/php7 folder in docker run
After recreating the docker in version 22.2.3 and restoring the postgres database to the previous status it starts with messages about missing PHP modules (which wasn’t the case before)
#php -v
PHP Warning: PHP Startup: Unable to load dynamic library ‘calendar.so’ (tried: /usr/lib/php7/modules/calendar.so (Error loading shared library


*/

the following could be partially solved, somehow NC 23 comes with some apps that needs to be upgraded but since the ./apps folder was mounted ‘writable’ => false in my docker, the upgrade fails,

Now back on Version 22.2.3 I still get:

#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
Updating database schema
Updated database
Updating <workflow_ocr> 

Updated <workflow_ocr> to 1.22.4
Updating 

Updated to 2.4.0
Updating 

Updated to 1.5.0
Checking for update of app accessibility in appstore
Checked for update of app “accessibility” in App Store
Checking for update of app activity in appstore
Checked for update of app “activity” in App Store
Checking for update of app admin_audit in appstore
Checked for update of app “admin_audit” in App Store
Checking for update of app cloud_federation_api in appstore
Checked for update of app “cloud_federation_api” in App Store
Checking for update of app comments in appstore
Checked for update of app “comments” in App Store
Checking for update of app contactsinteraction in appstore
Checked for update of app “contactsinteraction” in App Store
Checking for update of app dav in appstore
Checked for update of app “dav” in App Store
Checking for update of app federatedfilesharing in appstore
Checked for update of app “federatedfilesharing” in App Store
Checking for update of app federation in appstore
Checked for update of app “federation” in App Store
Checking for update of app files in appstore
Checked for update of app “files” in App Store
Checking for update of app files_external in appstore
Checked for update of app “files_external” in App Store
Checking for update of app files_pdfviewer in appstore
Checked for update of app “files_pdfviewer” in App Store
Checking for update of app files_rightclick in appstore
Checked for update of app “files_rightclick” in App Store
Checking for update of app files_sharing in appstore
Checked for update of app “files_sharing” in App Store
Checking for update of app files_trashbin in appstore
Checked for update of app “files_trashbin” in App Store
Checking for update of app files_versions in appstore
Checked for update of app “files_versions” in App Store
Checking for update of app files_videoplayer in appstore
Checked for update of app “files_videoplayer” in App Store
Checking for update of app fileslibreofficeedit in appstore
Checked for update of app “fileslibreofficeedit” in App Store
Checking for update of app logreader in appstore
Checked for update of app “logreader” in App Store
Checking for update of app lookup_server_connector in appstore
Checked for update of app “lookup_server_connector” in App Store
Checking for update of app nextcloud_announcements in appstore
Checked for update of app “nextcloud_announcements” in App Store
Checking for update of app notifications in appstore
Checked for update of app “notifications” in App Store
Checking for update of app oauth2 in appstore
Checked for update of app “oauth2” in App Store
Checking for update of app password_policy in appstore
Checked for update of app “password_policy” in App Store
Checking for update of app photos in appstore
Checked for update of app “photos” in App Store
Checking for update of app privacy in appstore
Checked for update of app “privacy” in App Store
Checking for update of app provisioning_api in appstore
Checked for update of app “provisioning_api” in App Store
Checking for update of app recommendations in appstore
Checked for update of app “recommendations” in App Store
Checking for update of app serverinfo in appstore
Checked for update of app “serverinfo” in App Store
Checking for update of app settings in appstore
Checked for update of app “settings” in App Store
Checking for update of app sharebymail in appstore
Checked for update of app “sharebymail” in App Store
Checking for update of app support in appstore
Checked for update of app “support” in App Store
Checking for update of app systemtags in appstore
Checked for update of app “systemtags” in App Store
Checking for update of app text in appstore
Checked for update of app “text” in App Store
Checking for update of app theming in appstore
Checked for update of app “theming” in App Store
Checking for update of app twofactor_backupcodes in appstore
Checked for update of app “twofactor_backupcodes” in App Store
Checking for update of app updatenotification in appstore
Checked for update of app “updatenotification” in App Store
Checking for update of app user_ldap in appstore
Checked for update of app “user_ldap” in App Store
Checking for update of app user_status in appstore
Checked for update of app “user_status” in App Store
Checking for update of app viewer in appstore
Checked for update of app “viewer” in App Store
Checking for update of app weather_status in appstore
Checked for update of app “weather_status” in App Store
Checking for update of app workflow_ocr in appstore
Checked for update of app “workflow_ocr” in App Store
Checking for update of app workflowengine in appstore
Checked for update of app “workflowengine” in App Store
Starting code integrity check

Finished code integrity check
Update successful
Turned off maintenance mode
Resetting log level

and again:
#occ status
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

  • installed: true
  • version: 22.2.3.0
  • versionstring: 22.2.3
  • edition:

in the browser it comes up as:

App-Aktualisierung notwendig

Bitte stelle vor dem Fortsetzen sicher, dass die Datenbank, der Konfigurationsordner und der Datenordner gesichert wurden.

Zur Vermeidung von ZeitĂŒberschreitungen bei grĂ¶ĂŸeren Installationen kannst Du stattdessen den folgenden Befehl in Deinem Installationsverzeichnis ausfĂŒhren:

./occ upgrade

Regardless how often I press “Aktualisierung starten” it always runs without an error and comes up with the same message

“Nextcloud needs a defined proceedure for rollbacks, otherwise noone would ever upgrade in a real production environment.”

the log shows:

Update vorbereiten
Log-Level auf “debug” gesetzt
Wartungsmodus eingeschaltet
Repair MySQL collation
Not a mysql database → nothing to do
Repair SQLite autoincrement
Copy data from accounts table when migrating from ownCloud
Drop account terms table when migrating from ownCloud
Das Datenbankschema wird aktualisiert
Datenbank aktualisiert
“workflow_ocr” aktualisiert auf 1.22.4
Populating added database structures for workflows
“workflowengine” aktualisiert auf 2.4.0
Switches from default updater server to the customer one if a valid subscription is available
Repair step already executed
“support” aktualisiert auf 1.5.0
Suche nach einer Aktualisierung fĂŒr die App “accessibility” im App-Store
App-Store auf Aktualisierung fĂŒr die App “accessibility” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “activity” im App-Store
App-Store auf Aktualisierung fĂŒr die App “activity” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “admin_audit” im App-Store
App-Store auf Aktualisierung fĂŒr die App “admin_audit” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “cloud_federation_api” im App-Store
App-Store auf Aktualisierung fĂŒr die App “cloud_federation_api” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “comments” im App-Store
App-Store auf Aktualisierung fĂŒr die App “comments” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “contactsinteraction” im App-Store
App-Store auf Aktualisierung fĂŒr die App “contactsinteraction” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “dav” im App-Store
App-Store auf Aktualisierung fĂŒr die App “dav” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “federatedfilesharing” im App-Store
App-Store auf Aktualisierung fĂŒr die App “federatedfilesharing” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “federation” im App-Store
App-Store auf Aktualisierung fĂŒr die App “federation” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “files” im App-Store
App-Store auf Aktualisierung fĂŒr die App “files” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “files_external” im App-Store
App-Store auf Aktualisierung fĂŒr die App “files_external” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “files_pdfviewer” im App-Store
App-Store auf Aktualisierung fĂŒr die App “files_pdfviewer” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “files_rightclick” im App-Store
App-Store auf Aktualisierung fĂŒr die App “files_rightclick” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “files_sharing” im App-Store
App-Store auf Aktualisierung fĂŒr die App “files_sharing” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “files_trashbin” im App-Store
App-Store auf Aktualisierung fĂŒr die App “files_trashbin” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “files_versions” im App-Store
App-Store auf Aktualisierung fĂŒr die App “files_versions” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “files_videoplayer” im App-Store
App-Store auf Aktualisierung fĂŒr die App “files_videoplayer” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “fileslibreofficeedit” im App-Store
App-Store auf Aktualisierung fĂŒr die App “fileslibreofficeedit” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “logreader” im App-Store
App-Store auf Aktualisierung fĂŒr die App “logreader” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “lookup_server_connector” im App-Store
App-Store auf Aktualisierung fĂŒr die App “lookup_server_connector” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “nextcloud_announcements” im App-Store
App-Store auf Aktualisierung fĂŒr die App “nextcloud_announcements” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “notifications” im App-Store
App-Store auf Aktualisierung fĂŒr die App “notifications” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “oauth2” im App-Store
App-Store auf Aktualisierung fĂŒr die App “oauth2” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “password_policy” im App-Store
App-Store auf Aktualisierung fĂŒr die App “password_policy” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “photos” im App-Store
App-Store auf Aktualisierung fĂŒr die App “photos” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “privacy” im App-Store
App-Store auf Aktualisierung fĂŒr die App “privacy” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “provisioning_api” im App-Store
App-Store auf Aktualisierung fĂŒr die App “provisioning_api” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “recommendations” im App-Store
App-Store auf Aktualisierung fĂŒr die App “recommendations” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “serverinfo” im App-Store
App-Store auf Aktualisierung fĂŒr die App “serverinfo” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “settings” im App-Store
App-Store auf Aktualisierung fĂŒr die App “settings” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “sharebymail” im App-Store
App-Store auf Aktualisierung fĂŒr die App “sharebymail” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “support” im App-Store
App-Store auf Aktualisierung fĂŒr die App “support” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “systemtags” im App-Store
App-Store auf Aktualisierung fĂŒr die App “systemtags” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “text” im App-Store
App-Store auf Aktualisierung fĂŒr die App “text” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “theming” im App-Store
App-Store auf Aktualisierung fĂŒr die App “theming” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “twofactor_backupcodes” im App-Store
App-Store auf Aktualisierung fĂŒr die App “twofactor_backupcodes” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “updatenotification” im App-Store
App-Store auf Aktualisierung fĂŒr die App “updatenotification” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “user_ldap” im App-Store
App-Store auf Aktualisierung fĂŒr die App “user_ldap” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “user_status” im App-Store
App-Store auf Aktualisierung fĂŒr die App “user_status” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “viewer” im App-Store
App-Store auf Aktualisierung fĂŒr die App “viewer” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “weather_status” im App-Store
App-Store auf Aktualisierung fĂŒr die App “weather_status” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “workflow_ocr” im App-Store
App-Store auf Aktualisierung fĂŒr die App “workflow_ocr” geprĂŒft
Suche nach einer Aktualisierung fĂŒr die App “workflowengine” im App-Store
App-Store auf Aktualisierung fĂŒr die App “workflowengine” geprĂŒft
Repair MySQL collation
Not a mysql database → nothing to do
Repair mime types
Clean tags and favorites
0 tags of deleted users have been removed.
0 tags for delete files have been removed.
0 tag entries for deleted tags have been removed.
0 tags with no entries have been removed.
Repair invalid shares
Move .step file of updater to backup location
Add move avatar background job
Repair step already executed
Add preview cleanup background jobs
Fix potential broken mount points
No mounts updated
Repair language codes
Install new core bundle components
Add log rotate job
Clear frontend caches
Image cache cleared
SCSS cache cleared
JS cache cleared
Clear every generated avatar on major updates
Add preview background cleanup job
Queue a one-time job to cleanup old backups of the updater
Cleanup invalid photocache files for carddav
Add background job to cleanup login flow v2 tokens
Remove potentially over exposing share links
No need to remove link shares.
Clear access cache of projects
Reset generated avatar flag
Keep legacy encryption enabled
Check encryption key format
Remove old dashboard app config data
Add job to cleanup the bruteforce entries
Queue a one-time job to check for user uploaded certificates
Repair DAV shares
Add background job to set the lookup server share state for users
Code-IntegritĂ€t wird ĂŒberprĂŒft
Code-IntegritĂ€tsprĂŒfung abgeschlossen
Wartungsmodus ausgeschaltet
UrsprĂŒngliches Log-Level wiederhergestellt

The update script is obviously stuck in a loop to update:

  • Deleted files (files_trashbin)
  • Versions (files_versions)
  • Video player (files_videoplayer)
  • Workflow OCR (workflow_ocr)

Maybe it’s just the version that isn’t recorgnized correctly. Is it possible to remove such info from the database (or wherever it may be stored) and it get’s automatically restored on the next start or can I correct these values?

possible solution a)
occ app:disable|remove files_trashbin 

doesn’t do the job, it responds:


→ files_trashbin could not be removed as it is a shipped app


and:
occ app:install --force files_trashbin
→ files_trashbin already installed

This is for all 4 apps listed above.

possible solution b)
edit config.php and change the ‘version’ => ‘23.0.0.10’ to ‘23.0.0.8’
then run /updater/updater.phar
and then occ upgrade


→ still, those 4 apps remain to be upgraded

to mention:
#occ config:app:get files_trashbin installed_version
→ 1.12.0
#occ config:app:set --value 1.13.0 --update-only files_trashbin installed_version
→ Config value installed_version for app files_trashbin set to 1.13.0
but then again:
#occ config:app:get files_trashbin installed_version
→ 1.12.0

So it seems as the occ command doesn’t get a NACK eventough it failed to update
#occ config:list


“files_trashbin”: {
“enabled”: “yes”,
“types”: “filesystem,dav”,
“installed_version”: “1.12.0”
},



1 Like

what I’ve done now in psql:
SELECT * FROM “oc_appconfig” WHERE “appid” ~ ‘files_trashbin’ AND “configkey” ~ ‘installed_version’;
appid | configkey | configvalue
----------------±------------------±------------
files_trashbin | installed_version | 1.12.0
(1 row)
UPDATE “oc_appconfig” SET configvalue = ‘1.13.0’ WHERE “appid” ~ ‘files_trashbin’ AND “configkey” ~ ‘installed_version’;


So I did for the other 3 apps as well.
And so:
/config/www/nextcloud/updater/updater.phar
→ Update of code successful.
→ Should the “occ upgrade” command be executed? [Y/n] y


2021-12-09 11:26:53 Maintenance mode is kept active
2021-12-09 11:26:53 Resetting log level
Keep maintenance mode active? [y/N] n
Maintenance mode disabled
Maintenance mode is disabled

→ Anyway, calling up the URL to my cloud I still get:
" Wartungsmodus

Diese -Instanz befindet sich gerade im Wartungsmodus, was eine Weile dauern kann. Diese Seite aktualisiert sich automatisch, sobald Nextcloud wieder verfĂŒgbar ist.

Kontaktieren Sie Ihren Systemadministrator, wenn diese Meldung dauerhaft oder unerwartet erscheint."

at least:
#occ upgrade
Nextcloud is already latest version

#occ status

  • installed: true
  • version: 23.0.0.10
  • versionstring: 23.0.0
  • edition:
  • maintenance: false
  • needsDbUpgrade: false
  • productname: Nextcloud
  • extendedSupport: false
1 Like

ok, here is the solution:
all my database connection (postgres, redis and memcached) are via socket to other containers.
since these sockets are in the subdirectories
/run/memcached
/run/postgresql
/run/redis
and those directories belong to the UIDs of the other containers, (eg, 999 for postgresql) and the default for subdirectories in /run is drwxr-xr-x my nextcloud instance couln’t write to the database
So whatever the update scripts did it was lost at that point.

1 Like