Nextcloud tries to reinstall on update

I tried to update my nextclound instance from nextcloud:29.0.9-apache to nextcloud:30.0.2-apache by swapping the image in my docker-compose.yml. This worked perfectly in the past, however it now tries to re-install. If go back to version 29, I can start nextcloud again. Any advice on how to make the update?

Here is the log:

System info:

  • Linux ubuntu-4gb-nbg1-1 5.4.0-200-generic #220-Ubuntu SMP Fri Sep 27 13:19:16 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • Docker version 20.10.21, build 20.10.21-0ubuntu1~20.04.2

Please post your Compose file and also post the precise commands you posted to upgrade your stack.

Refs: Nextcloud Docker Image: Upgrading.

Thanks for your answer @jtr

the compose file looks like:

version: "3.7"

services:
  nextcloud:
    restart: unless-stopped
    image: nextcloud:29.0.9-apache
    depends_on:
      - postgres
      - redis
    environment:
      # nc
      NEXTCLOUD_ADMIN_USER: ${NC_ADMIN_USER}
      NEXTCLOUD_ADMIN_PASSWORD: ${NC_ADMIN_PW}
      NEXTCLOUD_TRUSTED_DOMAINS: cloud.${DOMAIN}
      # redis
      REDIS_HOST: redis
      # db
      POSTGRES_HOST: postgres
      POSTGRES_DB: nextcloud
      POSTGRES_USER: nextcloud
      POSTGRES_PASSWORD: ${PG_PASSWORD}
      # mail
      SMTP_HOST: in-v3.mailjet.com
      SMTP_SECURE: tls
      SMTP_PORT: 25
      SMTP_AUTHTYPE: PLAIN
      SMTP_NAME: ${SMTP_NAME}
      SMTP_PASSWORD: ${SMTP_PASSWORD}
      MAIL_FROM_ADDRESS: no-reply
      MAIL_DOMAIN: ${DOMAIN}
      # Upload size
      APACHE_BODY_LIMIT: 10737418240
      PHP_UPLOAD_LIMIT: 10G
    volumes:
      - ./nextcloud-data/:/var/www/html/data
      - ./nextcloud-custom_apps/:/var/www/html/custom_apps
      - ./nextcloud-config/:/var/www/html/config
    labels:
      # Basic
      - "traefik.enable=true"
      - "traefik.http.services.nextcloud.loadbalancer.server.port=80"
      # Router
      - "traefik.http.routers.nextcloud.service=nextcloud"
      - "traefik.http.routers.nextcloud.rule=Host(`cloud.${DOMAIN}`)"
      - "traefik.http.routers.nextcloud.entrypoints=websecure"
      - "traefik.http.routers.nextcloud.tls=true"
      - "traefik.http.routers.nextcloud.tls.certresolver=letsencrypt"
      - "traefik.http.routers.nextcloud.middlewares=nc-rep,nc-header"
      # Middleware: Calendar
      - "traefik.http.middlewares.nc-rep.redirectregex.regex=https://(.*)/.well-known/(card|cal)dav"
      - "traefik.http.middlewares.nc-rep.redirectregex.replacement=https://$$1/remote.php/dav/"
      - "traefik.http.middlewares.nc-rep.redirectregex.permanent=true"
      # Middleware: Header
      - "traefik.http.middlewares.nc-header.headers.referrerPolicy=no-referrer"
      - "traefik.http.middlewares.nc-header.headers.stsSeconds=31536000"
      - "traefik.http.middlewares.nc-header.headers.forceSTSHeader=true"
      - "traefik.http.middlewares.nc-header.headers.stsPreload=true"
      - "traefik.http.middlewares.nc-header.headers.stsIncludeSubdomains=true"
      - "traefik.http.middlewares.nc-header.headers.browserXssFilter=true"

  postgres:
    image: postgres:16
    restart: unless-stopped
    environment:
      POSTGRES_USER: nextcloud
      POSTGRES_PASSWORD: ${PG_PASSWORD}
      POSTGRES_DB: nextcloud
    volumes:
      - ./postgres/:/var/lib/postgresql/data

  redis:
    restart: unless-stopped
    image: redis:7.2

  traefik:
    image: traefik:3.1
    restart: unless-stopped
    command:
      - --api=true
      - --api.dashboard=true
      - --providers.docker=true
      - --providers.docker.exposedByDefault=false
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
      - --certificatesResolvers.letsencrypt.acme.email=${EMAIL}
      - --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
      - --certificatesResolvers.letsencrypt.acme.tlsChallenge=true
    ports:
      - "80:80"
      - "443:443"
    labels:
      - "traefik.enable=true"
      # Dashboard
      - "traefik.http.routers.api.rule=Host(`traefik.${DOMAIN}`)"
      - "traefik.http.routers.api.service=api@internal"
      - "traefik.http.routers.api.middlewares=admin"
      - "traefik.http.routers.api.tls.certresolver=letsencrypt"
      - "traefik.http.routers.api.entrypoints=websecure"
      - "traefik.http.middlewares.admin.basicauth.users=${BASIC_AUTH}"

      # middleware redirect
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"

      # global redirect to https
      - "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
      - "traefik.http.routers.redirs.entrypoints=web"
      - "traefik.http.routers.redirs.middlewares=redirect-to-https"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./letsencrypt/:/letsencrypt/

The commands to update is just:

  • open compose file and change the image
  • docker-compose up -d nextcloud
  • (I also tried it with stopping the container before manually docker-compose stop nextcloud)

hm, I just tried to update to 29.0.10 but having the same issue there. So it seems not to be related to any specific version, just any update.

Strange thing is, I still can run other occ comands. E.g. occ config:list system

{
    "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
        },
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpsecure": "tls",
        "mail_smtpauthtype": "PLAIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "cloud.xxx"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "29.0.9.2",
        "overwrite.cli.url": "https:\/\/cloud.xxx",
        "overwritehost": "cloud.xxx",
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpauth": true,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2,
        "maintenance": false,
        "default_phone_region": "DE",
        "maintenance_window_start": 1,
        "theme": ""
    }
}

Okay, I was able to get it up again by performing the update via occ directly. After the update to v30, I ran into the same and recovered it again via occ upgrade. Still not sure how to really solve this issue.

Your app container’s volumes configuration is insufficient. You lack coverage of /var/www/html.

See: