Custom Docker image: Nextcloud update issues

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 28.0.4.1
Operating system and version (eg, Ubuntu 20.04): Debian 10 Docker Image
Apache or nginx version (eg, Apache 2.4.25): 2.4.38
PHP version (eg, 7.4): 8.1

The issue you are facing:

The update proccess stuck in the step 6

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

Steps to replicate it:

  1. Run the updater via web and via console
  2. stuck on step 6

The output of your Nextcloud log in Admin > Logging: Via console because the update disabled the admin access I get

Extracting ...PHP Warning:  require(/app/updater/../version.php): Failed to open stream: No such file or directory in phar:///app/updater/updater.phar/lib/Updater.php on line 694
PHP Fatal error:  Uncaught Error: Failed opening required '/app/updater/../version.php' (include_path='.:/usr/local/lib/php') in phar:///app/updater/updater.phar/lib/Updater.php:694
Stack trace:
#0 phar:///app/updater/updater.phar/lib/Updater.php(732): NC\Updater\Updater->getVersionByVersionFile('/app/updater/.....')
#1 phar:///app/updater/updater.phar/lib/UpdateCommand.php(384): NC\Updater\Updater->extractDownload()
#2 phar:///app/updater/updater.phar/lib/UpdateCommand.php(237): NC\Updater\UpdateCommand->executeStep(6)
#3 phar:///app/updater/updater.phar/vendor/symfony/console/Command/Command.php(255): NC\Updater\UpdateCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 phar:///app/updater/updater.phar/vendor/symfony/console/Application.php(1021): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 phar:///app/updater/updater.phar/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand(Object(NC\Updater\UpdateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 phar:///app/updater/updater.phar/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 phar:///app/updater/updater.phar/updater.php(10): Symfony\Component\Console\Application->run()
#8 /app/updater/updater.phar(14): require('phar:///app/upd...')
#9 {main}

it seems the updater doesn’t find version.php file - does it exist?

In case you are really running Docker install “running updater via web or console” is a wrong way to update: Docker upgrade procedure

1 Like

I think you nailed it! @wwe

I think they’re running a Debian 10 image in Docker then installing Nextcloud Server within that from the tarball.

Can you post the output of occ config:list system?

Extracting ...PHP Warning: require(/app/updater/../version.php): Failed to open stream: No such file or directory in phar:///app/updater/updater.phar/lib/Updater.php on line 694

Also, can you share a bit about the underlying filesystem structure and mount types within your Docker container.

Also, does /app/version.php exist on disk? From the looks of it I presume your installation folder is /app, correct?

It might be helpful to simply share your Compose file too.

The version.php file does not exist. The file was removed when running the updater.

The mount only has the path where I have NC mounted on app.

I will omit some data in the docker compose file.

services:
  db:
    image: 'mariadb:latest'
    restart: always
    container_name: nextcloud_mariadb
    command: '--transaction-isolation=READ-COMMITTED --binlog-format=ROW'
    volumes:
      - '/path/to/nextcloud/db:/var/lib/mysql'
    environment:
      - 
    deploy:
      resources:
        limits:
          cpus: '0.33'
          memory: 3G
        reservations:
          cpus: '0.175'
          memory: 1G
  php-apache:
    image: 'webdevops/php-apache:8.1'
    restart: always
    container_name: nextcloud
    working_dir: /app
    depends_on:
      - db
      - redis
    environment:
      - 
    volumes:
      - '/path/to/nextcloud:/app'
      - '/path/to/data/data:/app/data'
    ports:
      - '8080:80'
      - '4443:443'
    deploy:
      resources:
        limits:
          cpus: '0.33'
          memory: 3G
        reservations:
          cpus: '0.175'
          memory: 1G
  redis:
    image: redis
    restart: always
    container_name: nextcloud_redis
    deploy:
      resources:
        limits:
          cpus: '0.33'
          memory: 3G
        reservations:
          cpus: '0.175'
          memory: 1G
    depends_on:
      - db
    ports:
      - '6380:6379'

The version.php file does not exist. The file was removed when running the updater.

Did the Updater fail previously on a later step and perhaps and this is a re-run? Because no files get deleted until at least step 9. Rather than guess, perhaps you can simply provide your actual updater.log?

Can you post the output of occ config:list system?

Also this would still be helpful.

you are using custom docker image which is unfamiliar here. I would recommend to ask support from the image creator.
for me looks like Apache where you might have “manually” installed Nextcloud like on bare-metal…

your mount mounts include only apps and data (at the first glance) - usually Nextcloud images have another “config” mount - this might be not necessary for your image but again this seems to be a very weird way to run Nextcloud in a container - better you consult the docs and support of the respective project.

In general I would recommend “more common” approach like AiO, community docker, snap, VM or NCP which makes it easier to get support.

I solved downloading the 28.0.4 zip file and putting the deleted files/folders in my NC directory.

From the web ui, I saw a json exception error but the message was empty, and searching deeper the updater log I found:

2024-05-02T18:54:42-0500 RtkFy6Ga0u [error] POST request failed with other exception
2024-05-02T18:54:42-0500 RtkFy6Ga0u [error] Exception: Exception
Message: core/shipped.json is not available
Code:0
Trace:
#0 /app/updater/index.php(1360): Updater->deleteOldFiles()
#1 {main}
File:/app/updater/index.php
Line:867

A first post I think made by the updater, and after other similar made when I clicked the button.

Unfortunately that second entry mostly just validates what I suspected: one of your prior Updater runs got further and had already deleted the files. That explains why you had problems in subsequent runs, but it still doesn’t suggest the original root cause.

If you can post the entire updater.log (at least the portions dated recently covering all of the 28.0.4->28.0.5 update attempts), that would be possibly insightful.