App Version Mismatch after Upgrade (DB vs Filesystem)

The Basics

Nextcloud Server version: 33.0.2.2

Operating system and version: AlmaLinux 9.7 (Linux 5.14+)

Web server and version: Apache 2.4.66 (Official Docker Image)

Reverse proxy and version: Cloudflare Tunnel (cloudflared)

PHP version: 8.3.30

Is this the first time you’ve seen this error?: Yes, specifically after a major version upgrade.

When did this problem seem to first start?: After upgrading the Docker image from a previous version to Hub 9 (v33).

Installation method: Docker Compose with a monolithic volume mapping (Host ./data mapped to Container /var/www/html).

Summary of the issue you are facing: After upgrading to Nextcloud 33, several core/shipped apps are stuck in a “Disabled” state with a persistent version mismatch. Running occ app:list shows entries like app_api: 33.0.0 (installed 32.0.0) or dashboard: 7.13.0 (installed 7.10.0).

Update: I have already resolved the initial 401 Unauthorized errors and UI access issues by fixing user directory visibility and running a full files:scan. Currently, the only remaining problem is the version mismatch for these core apps, which prevents them from being enabled or appearing in the UI.

Steps to replicate it:

  1. Use a Docker deployment where the entire /var/www/html is a persistent volume.

  2. Upgrade the Docker image to a new major version.

  3. Observe that core apps (shipped with the image) remain tied to their old versions in the database metadata while the filesystem has been updated.


Troubleshooting steps taken

  1. Ownership/Permissions: Verified all files are owned by UID 33 (www-data). Ran chown -R 33:33 and chmod -R 750 on the data directory.

  2. Filesystem Scan: Ran occ files:scan --all which successfully restored visibility to the users’ files and fixed the 401 errors.

  3. Manual App Reinstallation:

    • Successfully fixed calendar and contacts by running occ app:remove followed by occ app:install.

    • Attempted the same for core apps like dashboard or app_api, but received errors: “App cannot be installed because it is not compatible with this version of the server” or “Not found on the appstore”.

  4. Code Resync from Source:

    • Since these are shipped apps, I manually copied the clean code from the Docker image source to the volume: docker exec nextcloud-app cp -ra /usr/src/nextcloud/apps/. /var/www/html/apps/

    • Verified that physical directories now contain the new code, but occ app:list still reports the old version as “installed”.

  5. Maintenance: Ran occ maintenance:repair --include-expensive multiple times and even tried occ upgrade.


Log entries

Nextcloud (nextcloud.log - previous resource errors)

{"reqId":"AAa51...","level":3,"time":"2026-04-29T15:24:14+00:00","remoteAddr":"X.X.X.X","user":"admin","app":"jsresourceloader","method":"GET","url":"/settings/users","message":"Could not find resource calendar/js/calendar-contacts-menu.js to load","version":"33.0.2.2"}
{"reqId":"j5KA6...","level":3,"time":"2026-04-29T15:24:32+00:00","remoteAddr":"X.X.X.X","user":"admin","app":"index","method":"GET","url":"/apps/files/","message":"image not found: image:calendar-dark.svg webroot: serverroot:/var/www/html","version":"33.0.2.2","exception":"RuntimeException"}


Configuration

Nextcloud (config.php snippet)

<?php
$CONFIG = array (
  'memcache.local' => '\OC\Memcache\APCu',
  'memcache.distributed' => '\OC\Memcache\Redis',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => array(
    'host' => 'nextcloud-redis',
    'port' => 6379,
  ),
  'trusted_proxies' => array('172.16.0.0/12', '127.0.0.1'),
  'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR'),
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => 'https://cloud.mydomain.com',
);

Apps (occ app:list)

Enabled:
  - activity: 6.0.0
  - calendar: 6.2.3
  - contacts: 8.4.5
Disabled:
  - app_api: 33.0.0 (installed 32.0.0)
  - dashboard: 7.13.0 (installed 7.10.0)
  - firstrunwizard: 6.0.0 (installed 3.0.0)
  - recommendations: 6.0.0 (installed 3.0.0)
  - weather_status: 1.13.0 (installed 1.12.0)

What is the correct way to force Nextcloud to “re-read” the app versions from the filesystem for these shipped/core apps?

Any help is appreciated.

Best regards,

Mauricio López

Please post your full config not just a snippet, particularly since apps paths and merged configs are relevant. Use occ config:list system specifically.

Also post your Docker Compose file.

For future reference, your Docker container startup log and Nextcloud log from the period of first attempting the image bump/upgrade will also likely have insight into what occurred.