Nextcloud upgrade from 27 to 28 stuck in loop with needsDBupgrade true from files app

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 28.0.14.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu Jammy in Docker
  • Web server and version (e.g, Apache 2.4.25):
    • `Apache 2.4``
  • PHP version (e.g, 8.3):
    • 8.1
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • after web upgrade from 27.1.11.3
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Docker
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

The web updater got stuck with db schema updates. I then switched to console and tried with òcc upgrade`.
This basically did all the db upgrades again that I was able to see before in web-updater. I saw a lot more happening and the last occ upgrade entry was

 - Remove activity entries of private events
     - Removed 0 activity entries

But if I ask about the 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: 28.0.14.1
  - versionstring: 28.0.14
  - edition:
  - maintenance: true
  - needsDbUpgrade: true
  - productname: Nextcloud
  - extendedSupport: false

and

occ config:system:get 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
27.1.11.3

So apparently something says it still needs upgrade. I dug into the code and found out, that version of core and apps are checked.
Core version was fine, but when it checks apps with shouldUpgrade in OC_App.php the files app apparently says it needs an upgrade.
I tried with occ app:uprade --all and some got upgrades, but nothing for the files app. As you can see below the files app is at version 1.22.0. I have no clue if this is fine.

Currently maintenance is still active, but if I disable it I’m prompted with Start Upgrade again in web-updater.

Any idea how I can get this fixed?

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "some.domain.com",
            "172.17.0.2",
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.14.1",
        "overwriteprotocol": "https",
        "overwrite.cli.url": "https:\/\/some.domain.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "updater.release.channel": "stable",
        "maintenance": true,
        "theme": "",
        "loglevel": 0,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "htaccess.RewriteBase": "\/",
        "updater.secret": "***REMOVED SENSITIVE VALUE***",
        "filelocking.enabled": true,
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "app_install_overwrite": [
            "dicomviewer"
        ],
        "memcache.local": "\\OC\\Memcache\\APCu",
        "default_phone_region": "DE"
    }
}

Apps

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
Enabled:
  - activity: 2.19.0
  - bruteforcesettings: 2.7.0
  - circles: 27.0.1
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contacts: 5.5.3
  - contactsinteraction: 1.8.0
  - dashboard: 7.7.0
  - dav: 1.27.1
  - dicomviewer: 2.3.0
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_external: 1.19.0
  - files_pdfviewer: 2.8.0
  - files_photospheres: 1.28.3
  - files_reminders: 1.0.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - maps: 1.4.0
  - metadata: 0.21.0
  - nextcloud_announcements: 1.16.0
  - notes: 4.11.0
  - notifications: 2.15.0
  - oauth2: 1.15.2
  - onlyoffice: 9.5.0
  - password_policy: 1.17.0
  - photos: 2.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - spreed: 18.0.14
  - support: 1.10.1
  - survey_client: 1.15.0
  - systemtags: 1.17.0
  - text: 3.8.1
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - updatenotification: 1.17.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - workflow_script: 1.13.1
  - workflowengine: 2.9.0
Disabled:
  - admin_audit: 1.18.0
  - encryption: 2.16.0
  - photosphereviewer: 0.0.3 (installed 0.0.3)
  - suspicious_login: 6.0.0
  - twofactor_totp: 10.0.0-beta.2
  - user_ldap: 1.19.0

Which image are you using? In the project’s Docker image, you don’t use the web updater. And your config suggests you’re not using that image nor the AIO one.

It is my own. An image based on Ubuntu Jammy with PHP enabled and config added, so NC has what is needed.
I started with NC 17 and I did not really understand how the officical NC image worked at that time, so I used my own.
Until yesterday it worked upgrading with the web-updater.
I don’t think the image is the problem if the files app apparently wants an update.
I read in some other posts, that I should try to use the backup of the application files and redo the update, but I’m asking myself if this is a good idea if the db upgrade apparently was done successfully?

Dug a bit deeper and found, that indeed the files app was updated. It contains what I can find on github for version 28.0.14.
And NC apparently thinks files app needs an update b/c the appinfo.xml contains version 2.0.0 but in my database the version states 1.22.0.
I started to adjust the version in the db for files and next was activity, only followed by bruteforce seetings.

I’m not sure if I should manually update the version string in the db, as I don’t know why the version string was not updated in the first place during the upgrade. Can anyone tell me, how I could achieve this with NC?

Another update from my side:
after manually fixing oc_appconfig database table so that the version string for the apps matches the app/info.xml and disable maintenance mode NC seems to work fine again.
At least I see no error messages, no white pages, sync works for various clients, I can login etc.
Apparently at some point in the upgrade process the app updates were interrupted. But manually updating the apps, was not enough.
Next update I’ll only use the cli tool and hope nothing like this happens again…