Update docker-compose setup from 31.0.6 to 31.0.9

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.6
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12
  • Web server and version (e.g, Apache 2.4.25):
    • ?
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • nginx:latest
  • PHP version (e.g, 8.3):
    • 8.3.26
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • Today when I've tried to update
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Docker Compose
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • Internally no.

Summary of the issue you are facing:

Hello.

I’ve had an installation of Nextcloud for some time now, I’ve used docker compose with the official image.

Today I checked for new versions and I wanted to update.

Researching through the forums I found out that the best way to upgrade with a docker compose installation is to just docker compose pull && docker compose up -d, so I’ve tried it.

When I first did it, it pulled a new image, then the container started properly.

The problem is that the web interface still shows as version 31.0.6 with an update available to 31.0.9.

I continued investigating and found out I have to run occ upgrade too, but it reports as no upgrades available, even after showing 1 update available when I ran occ update:check.

I’ve checked and the docker is using the 31.0.9 version.

So, my question is, how can I successfully upgrade to that version when using a docker-compose setup?

NOTE: I also saw different posts talking about updater.phar, but I don’t have that file in my installation.

Thank you.

Steps to replicate it (hint: details matter!):

Haven’t tested it. But I guess that running an older docker-compose setup and upgrading the version of the docker image could be enough.

Log entries

I don’t know exactly what to send here.

Configuration

Nextcloud

The output of 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
            }
        ],
        "upgrade.disable-web": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.oripasa.net"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.6.2",
        "overwrite.cli.url": "http:\/\/nextcloud.oripasa.net",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": true,
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "maintenance_window_start": 1
    }
}

Apps

The output of occ app:list (if possible).

Enabled:
  - activity: 4.0.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - deck: 1.15.1
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - encryption: 2.19.0
  - files_external: 1.23.0
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_ldap: 1.22.0

Hello @Kiu,
welcome to the community of Nextcloud :handshake:

for docker-compose questions its beneficial to post your compose file. did you define the version there?
I would also recommend not only pull+up but docker compose pull && dcker compose down && docker compose up -d please review update-to-a-newer-version procedure to see if there is something missing.

Regards,
wwe

1 Like

The problem is that the web interface still shows as version 31.0.6 with an update available to 31.0.9.

Check the Docker container output (e.g. something like docker compose app logs). When the container is recreated, the image’s bundled entrypoint script handles the entire upgrade process. Any problems (or successes will show up here). Always a good idea when upgrading or bringing up a container anyhow, since it’ll also tell you about other things, such as configuration files on your persistent storage that are out-of-date with the newer image(s).

My best guess without seeing your Compose file: you’re overriding the default CMD. In which case you’ll need to use the NEXTCLOUD_UPDATE environment variable as described here.

I continued investigating and found out I have to run occ upgrade too, but it reports as no upgrades available, even after showing 1 update available when I ran occ update:check.

The image’s entrypoint handles that. No need to do it manually, unless something is already wrong (and if something is already wrong that should be tackled first).

NOTE: I also saw different posts talking about updater.phar, but I don’t have that file in my installation.

That is correct. The integrated Updater is not used in that Docker image.

Hello to both.

I did forgot to post the docker compose file, first time here.

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb:10.6
    restart: always
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=M5PJKVUSi7ya5iCX
      - MYSQL_PASSWORD=dzidS26B438XgeXE
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
    networks:
      - dockernetwork

  nextcloudapp:
    image: nextcloud:31.0.9-apache
    restart: always
    #ports:
    #  - 8080:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
      - ./apache.conf:/etc/apache2/sites-available/000-default.conf:ro
      - ./certificates:/usr/local/apache2/conf/ssl:ro
      - ./entrypoint.sh:/entrypoint.sh:ro
    entrypoint: ["/entrypoint.sh"]
    environment:
      - MYSQL_PASSWORD=dzidS26B438XgeXE
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
    networks:
      - dockernetwork
    dns:
      - 172.17.0.1
networks:
  dockernetwork:
    external: true

Yep, seems to be that as I have a custom entrypoint. I did it to enable HTTPS and a custom certificate when I was using the Passwords app (I think it’s called like that, the password manager).

I’m not using it nowadays though, so I’ll just try to delete this custom entrypoint and modify my reverseproxy to point to the HTTP port.

On the other hand. regarding the NEXTCLOUD_UPDATE environment variable, I guess I would have to set it to 1 in my docker compose file and when I start them it triggers the process?

Now that I’m here (although if you prefer I’ll create another post).

Is it safe to have a script that periodically downloads the latest MINOR version and restarts the compose so it gets updated? This way I can just forget to lookup for versions and do it automatically. (This is how I have configured my OpenWEBUI).

Thank you both for all the info, once I do all the tests this night I’ll mark it as a solution. Because it seems that’s the reason.

Hello again.

Yeah, I didn’t get it to work with the NEXTCLOUD_UPDATE environment variable.

But as soon as I removed my custom entrypoint and all the related to it Nextcloud just updated properly.

Thank you both for the quick response!!

I’ll mark jtr message as solution.

1 Like

PD: I’m just left to upgrade to Nextcloud 32, but that’s a me problem now where I’ll have to read all the prerequisites and considerations :slight_smile:.