Upgrade from 29.0.6.1 to 29.0.7.1 successful but stuck in maintenance mode afterwards

Nextcloud version (eg, 29.0.5): 29.0.7.1
Operating system and version (eg, Ubuntu 24.04): docker
Apache or nginx version (eg, Apache 2.4.25): nginx
PHP version (eg, 8.3): from docker container

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N):

Steps to replicate it:

  1. Upgrade was successfull but i am stuck in maintenance mode

  1. Upgrade of app stuck

Output of occ upgrade:

docker exec -u www-data nextcloud /var/www/html/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

I waited for over 30 minutes but nothing further happens

Output of occ app update:

docker exec -u www-data nextcloud /var/www/html/occ app:update oauth2

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
oauth2 is up-to-date or no updates could be found

Output of maintenence disable:

docker exec -u www-data nextcloud /var/www/html/occ maintenance:mode --off

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
Maintenance mode disabled

Output of maintenance repair:

docker exec -u www-data nextcloud /var/www/html/occ maintenance:repair

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
 - Repair MySQL collation
     - Not a mysql database -> nothing to do
 - 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
 - Migrate oauth2_clients table to nextcloud schema

Stuck at this for 30+ minutes

The output of your Nextcloud log in Admin > Logging:

Docker container logs just show web access entries

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => '[redacted]',
    'port' => 6379,
  ),
  'instanceid' => '[redacted]',
  'passwordsalt' => '[redacted]',
  'secret' => '[redacted]',
  'trusted_domains' => 
  array (
    0 => '[redacted]'
  ),
  'trusted_proxies' => 
  array (
    0 => '[redacted]'
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '29.0.6.1',
  'overwrite.cli.url' => '[redacted]',
  'overwritehost' => '[redacted]',
  'dbname' => 'nextcloud',
  'dbhost' => 'postgresql',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '[redacted]',
  'installed' => true,
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => '[redacted]',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => '[redacted]',
  'mail_smtpport' => '465',
  'mail_smtpname' => '[redacted]',
  'mail_smtppassword' => '[redacted]',
  'loglevel' => 0,
  'log_type' => 'file',
  'logfile' => 'syslog',
  'maintenance' => true,
  'overwriteprotocol' => 'https',
  'mail_smtpauth' => 1,
  'check_data_directory_permissions' => false,
  'app_install_overwrite' => 
  array (
    0 => 'keeporsweep',
    1 => 'apporder',
    2 => 'news',
    3 => 'files_markdown',
  ),
  'theme' => '',
  'default_phone_region' => 'DE',
  'preview_max_x' => '512',
  'preview_max_y' => '512',
  'jpeg_quality' => 
  array (
    'occ' => 
    array (
      'config:app:set' => 
      array (
        'preview' => 
        array (
          'jpeg_quality' => '60',
        ),
      ),
    ),
  ),
);

Trying to disable the oauth2 app fails, too:

docker exec -u www-data nextcloud /var/www/html/occ app:disable oauth2

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
oauth2 can't be disabled.

How did you update? Was it via docker compose pull + docker compose up -d?

What was the output of the Docker container during that time? e.g. docker compose <container_name> logs?

Can you post the nextcloud.log content from the time window of the initial update/upgrade attempt?

Also post your Docker Compose file.

P.S. Unrelated (probably): Since the Docker image uses multiple config files, use occ config:list system to see your real active config. You appear to have some weird stuff at the end of your posted config related to the jpeg_quality parameter.

Yes i updated via docker compose pull and docker compose up.

This is from the container logs:

docker logs nextcloud
Configuring Redis as session handler
Initializing nextcloud 29.0.7.1 ...
Upgrading nextcloud from 29.0.6.1 ...
=> Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/pre-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
Configuring Redis as session handler
Warning: /var/www/html/config/apps.config.php differs from the latest version of this image at /usr/src/nextcloud/config/apps.config.php
Warning: /var/www/html/config/redis.config.php differs from the latest version of this image at /usr/src/nextcloud/config/redis.config.php
Warning: /var/www/html/config/reverse-proxy.config.php differs from the latest version of this image at /usr/src/nextcloud/config/reverse-proxy.config.php
Warning: /var/www/html/config/s3.config.php differs from the latest version of this image at /usr/src/nextcloud/config/s3.config.php
Warning: /var/www/html/config/smtp.config.php differs from the latest version of this image at /usr/src/nextcloud/config/smtp.config.php
Warning: /var/www/html/config/swift.config.php differs from the latest version of this image at /usr/src/nextcloud/config/swift.config.php
Warning: /var/www/html/config/upgrade-disable-web.config.php differs from the latest version of this image at /usr/src/nextcloud/config/upgrade-disable-web.config.php
=> Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/before-starting
[25-Sep-2024 08:59:10] NOTICE: fpm is running, pid 1
[25-Sep-2024 08:59:10] NOTICE: ready to handle connections
172.20.0.1 -  25/Sep/2024:08:59:32 +0000 "GET /index.php" 503
172.20.0.1 -  25/Sep/2024:08:59:28 +0000 "GET /index.php" 503

This is my config (after i removed the jpeg_quality stuff):

docker exec -u www-data nextcloud /var/www/html/occ config:list system
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
{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "29.0.6.1",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "overwritehost": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 0,
        "log_type": "file",
        "logfile": "syslog",
        "maintenance": true,
        "overwriteprotocol": "https",
        "mail_smtpauth": 1,
        "check_data_directory_permissions": false,
        "app_install_overwrite": [
            "keeporsweep",
            "apporder",
            "news",
            "files_markdown"
        ],
        "theme": "",
        "default_phone_region": "DE",
        "preview_max_x": "512",
        "preview_max_y": "512"
    }
}

This is the relevant part of my docker-compose.yml:

version: '2.3'
services:
  postgresql:
     container_name: postgresql
     restart: always
     image: postgres:12-alpine
     ports:
       - 5432:5432
     volumes:
       - /mnt/data/postgresql/data:/var/lib/postgresql/data
     command: postgres -c log_min_messages=LOG -c max_connections=200

  nextcloud:
     container_name: nextcloud
     restart: always
     image: nextcloud:stable-fpm
     ports:
       - 0.0.0.0:9000:9000
     volumes:
      - /mnt/data/nextcloud/data:/var/www/html
      - ~/nextcloud/postgresql:/var/lib/postgresql/data/
      - /mnt/data:/mnt/data:ro
      - /mnt/usb0:/mnt/usb0:ro
      - /mnt/data/nextcloud/php.ini:/usr/local/etc/php-fpm.d/www2.conf
     environment:
       POSTGRES_DB: nextcloud
       POSTGRES_USER: nextcloud
       POSTGRES_HOST: "192.168.1.11"
       NEXTCLOUD_TABLE_PREFIX: "oc_"
       REDIS_HOST: redis
       REDIS_HOST_PORT: 6379
       REDIS_HOST_PASSWORD: ""
     depends_on: 
       - redis
       - postgresql
     links:
       - redis
       - postgresql
     healthcheck:
       test: ["CMD", "curl", "-k", "-f", "https://192.168.1.x:443"]
       interval: 60s
       timeout: 20s
       retries: 3
       start_period: 30s
     cpus: 3
  redis:
     container_name: redis
     restart: always
     image: redis:6-alpine 

I found a solution myself:

  1. I moved oauth2 app from nextcloud/apps folder to some backup folder
  2. I ran docker exec -u www-data nextcloud /var/www/html/occ maintenance:repair and i finished
  3. Moved back the backuped oauth2 app folder to nextcloud/apps folder
  4. Ran docker exec -u www-data nextcloud /var/www/html/occ upgrade

After this Nextcloud is updated and working again :slight_smile:

Thanks @jtr for your interest!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.