markdumay/synology-docker

Can't make update in DSM 7.2-64561

Opened this issue · 4 comments

Describe the bug
Getting error provided below while trying to make update.

To reproduce
The invoked command: sudo ./syno_docker_update.sh update

Expected behavior
Docker should be updated without errors

Log file

sudo ./syno_docker_update.sh update                                                                                                                                                                                                                                                                                                          
Password:
Update Docker Engine and Docker Compose on Synology to target version

Current DSM version: 7.2
Current Docker version: 20.10.23
Current Docker Compose version: 2.9.0
Target Docker version: 24.0.1
Target Docker Compose version: 2.18.1

WARNING! This will replace:
  - Docker Engine
  - Docker Compose
  - Docker daemon log driver

Are you sure you want to continue? [y/N] y
Step 1 from 10: Downloading target Docker binary (https://download.docker.com/linux/static/stable/x86_64/docker-24.0.1.tgz)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 66.3M  100 66.3M    0     0  12.8M      0  0:00:05  0:00:05 --:--:-- 13.5M
Step 2 from 10: Downloading target Docker Compose binary (https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-linux-x86_64)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 52.0M  100 52.0M    0     0  4439k      0  0:00:11  0:00:11 --:--:-- 3666k
Step 3 from 10: Stopping Docker service
Step 4 from 10: Backing up current Docker binaries (/volume1/homes/vitalii/github/synology-docker/docker_backup_20230522_111542.tgz)
tar: /var/packages/Docker/target/usr: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
ERROR: Backup issue

Docker daemon configuration
Capture the content of the file /var/packages/Docker/etc/dockerd.json.

{
    "data-root" : "/var/packages/Docker/target/docker",
    "log-driver" : "json-file",
    "registry-mirrors" : [],
    "group": "administrators"
}

Additional context
Seems like Docker package was renamed from Docker to ContainerManager, so paths should be aligned with new package name

The bug is relatively easy to fix in the syno_docker_update.sh file iteself, simply change "Docker" to "ContainerManager":

  1. Line 30: readonly SYNO_DOCKER_SERV_NAME7='ContainerManager'"
  2. Line 32: readonly SYNO_DOCKER_DIR='/var/packages/ContainerManager'

Since there is now a difference between DSM 7.0/7.1 and 7.2, there should be a detection of the minor version if on DSM 7 at lines 625, 946 for the service name and a check for the path in SYNO_DOCKER_DIR based on the version before loading the other variables (SYNO_DOCKER_BIN_PATH, SYNO_DOCKER_SCRIPT_PATH, SYNO_DOCKER_JSON_PATH, SYNO_DOCKER_JSON_CONFIG)

after modifying syno_docker_update.sh with those two fixes (thanks @adubpak ) we get farther but still fail on step 9:

Update Docker Engine and Docker Compose on Synology to target version

Current DSM version: 7.2
Current Docker version: 20.10.23
Current Docker Compose version: 2.9.0
Target Docker version: 24.0.5
Target Docker Compose version: 2.20.3

WARNING! This will replace:
  - Docker Engine
  - Docker Compose
  - Docker daemon log driver

Are you sure you want to continue? [y/N] y
Step 1 from 10: Downloading target Docker binary (https://download.docker.com/linux/static/stable/x86_64/docker-24.0.5.tgz)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 66.5M  100 66.5M    0     0  4753k      0  0:00:14  0:00:14 --:--:-- 4935k
Step 2 from 10: Downloading target Docker Compose binary (https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 56.6M  100 56.6M    0     0  4560k      0  0:00:12  0:00:12 --:--:-- 4855k
Step 3 from 10: Stopping Docker service
{"action":"stop","beta":false,"error":{"code":0},"finished":true,"language":"enu","last_stage":"stopped","package":"ContainerManager","pid":12168,"scripts":[{"code":0,"message":"","type":"stop"}],"stage":"stopped","status":"stop","status_code":324,"status_description":"translate from systemd status","success":true,"username":"","version":"20.10.23-1413"}
Step 4 from 10: Backing up current Docker binaries (/volume1/homes/mtoups/synology-docker/docker_backup_20230815_113640.tgz)
bin/
bin/ctr
bin/auplink
bin/containerd-shim
bin/docker-compose
bin/docker-proxy
bin/containerd-shim-runc-v1
bin/runc
bin/containerd-shim-runc-v2
bin/docker-init
bin/containerd
bin/docker
bin/dockerd
bin/containerd-stress
dockerd.json
start-stop-status
Step 5 from 10: Extracting target Docker binary (/tmp/docker_update/docker-24.0.5.tgz)
docker/
docker/docker
docker/docker-init
docker/dockerd
docker/runc
docker/ctr
docker/containerd-shim-runc-v2
docker/containerd
docker/docker-proxy
Step 6 from 10: Installing binaries
Step 7 from 10: Configuring log driver
Step 8 from 10: Enabling IP forwarding
Step 9 from 10: Starting Docker service
{"action":"start","beta":false,"error":{"code":272,"description":"Failed to run script, script=[start]"},"finished":true,"language":"enu","last_stage":"prepare_start","package":"ContainerManager","pid":15168,"scripts":[{"code":1,"message":"","type":"start"}],"stage":"start_failed","status":"stop","status_code":311,"status_description":"translate from systemd status","success":false,"username":"","version":"20.10.23-1413"}
ERROR: Could not bring Docker Engine back online

Step 9 from 10: Starting Docker service

I initially had the same error: "ERROR: Could not bring Docker Engine back online"
By replacing the value of SYNO_DOCKER_SERV_NAME7 with "ContainerManager" as described above, this corrected the issue on my end.
It seems to be caused by the fact that the script cannot stop or restart the Docker service.

I think that the name ContainerManager might be case-sensitive?
Have you tried rebooting the NAS between tests and reinstalling "ContainerManager" from the app store before updating?

On my end, another issue I've come across seems to be that rebooting the NAS breaks the ContainerManager app.
I've had to reinstall it a couple of times and redoing the update.
DSM had an error message to "repair" (ie reinstall) ContainerManager after a reboot.

I haven't had the time to analyse the logs yet, to check if the update breaks something else following the naming change.

Thanks for the info. I dug into the logs and in my case the updated docker was failing to start due to aufs being removed from docker version 24. (I didn't realize I have that old storage format)

Until I can fix that, for now I got things working by getting the last version that still has aufs support: 23.0.6

So this worked better:

./syno_docker_update.sh -d 23.0.6 download .
./syno_docker_update.sh -d 23.0.6 install .