Can't upgrade to any docker-ce version post v20

My docker service dies when I try to update to v23 or v24
Forcing apt to come back to elder docker-ce packages correct the issue
(namely 5:20.10.23~3-0~debian-bullseye)

Help very much appreciated as I tried many things to no avail. Thanks in advance!

I get these error messages
mai 18 16:17:58 hydre systemd[1]: Starting Docker Application Container Engine…
mai 18 16:17:58 hydre dockerd[432429]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character ‘{’ after top-level value
mai 18 16:17:58 hydre systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
mai 18 16:17:58 hydre systemd[1]: docker.service: Failed with result ‘exit-code’.
mai 18 16:17:58 hydre systemd[1]: Failed to start Docker Application Container Engine.
mai 18 16:18:01 hydre systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.
mai 18 16:18:01 hydre systemd[1]: Stopped Docker Application Container Engine.
mai 18 16:18:01 hydre systemd[1]: Starting Docker Application Container Engine…
mai 18 16:18:01 hydre dockerd[433165]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character ‘{’ after top-level value
mai 18 16:18:01 hydre systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
mai 18 16:18:01 hydre systemd[1]: docker.service: Failed with result ‘exit-code’.
mai 18 16:18:01 hydre systemd[1]: Failed to start Docker Application Container Engine.
mai 18 16:18:03 hydre systemd[1]: docker.service: Scheduled restart job, restart counter is at 2.
mai 18 16:18:03 hydre systemd[1]: Stopped Docker Application Container Engine.
mai 18 16:18:03 hydre systemd[1]: Starting Docker Application Container Engine…
mai 18 16:18:03 hydre dockerd[436561]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character ‘{’ after top-level value
mai 18 16:18:03 hydre systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
mai 18 16:18:03 hydre systemd[1]: docker.service: Failed with result ‘exit-code’.
mai 18 16:18:03 hydre systemd[1]: Failed to start Docker Application Container Engine.
mai 18 16:18:05 hydre systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
mai 18 16:18:05 hydre systemd[1]: Stopped Docker Application Container Engine.
mai 18 16:18:05 hydre systemd[1]: docker.service: Start request repeated too quickly.
mai 18 16:18:05 hydre systemd[1]: docker.service: Failed with result ‘exit-code’.
mai 18 16:18:05 hydre systemd[1]: Failed to start Docker Application Container Engine.

systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─override.conf
Active: failed (Result: exit-code) since Thu 2023-05-18 16:18:05 CEST; 41s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 436561 ExecStart=/usr/bin/dockerd -H fd:// -H tcp://127.0.0.1:2375 (code=exited, status=1/FAILURE)
Main PID: 436561 (code=exited, status=1/FAILURE)
CPU: 71ms

mai 18 16:17:58 hydre systemd[422388]: srv-Docker-overlay2-7801e859482c4d3f4c8a8e8e5ec27fd196914ecdac2cf9dad11ff525847fbda2-merged.mount: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: Debian -- User Support
░░
░░ The unit UNIT has successfully entered the ‘dead’ state.

XXXXXXXXX
/etc/docker/daemon.json contains the following:
{
“data-root”: “/srv/Docker”
}
{
“storage-driver”: “overlay2”
}
{
“metrics-addr”: “127.0.0.1:9323”,
“experimental”: true
}

I am surprised your docker demon even starts with this daemon.json file, as it is not a valid json.

Assumed your configuration items are correct, the daemon.json should look like this:

{
    "data-root": "/srv/Docker",
    "storage-driver": "overlay2",
    "metrics-addr": "127.0.0.1:9323",
    "experimental": true
}

Once the daemon.json is correct, try to upgrade again.

Also, please format your existing and future posts according these instructions:

Thanks
I will try like that and report (but I think I did already, but couldn’t start docker with that formatting)

I just made those changes. You were right. Successfully migrated to v24
I think the thing I forgot were those commas that you rightfully added at the end of all lines beside the last one
Many many thanks for that!

It is not just the commas…A valid json document has one top level {} block (which can have nested blocks), and expects the end of file after the top level closing bracket. Your original daemon.json used three top level {} blocks, which makes it an invalid json document.

If your editor doesn’t lint json documents, you can always use online linters like https://jsonlint.com to verify the document is valid.

In my case, change true to “true” then the docker.service can startup.

"experimental": "true"