Hi all,
My docker compose VM went belly up so im building a new one. I have the compose.yaml files for all the containers.
Ubuntu 24 VM and updated docker. Its strange, I have 17 containers and only 5 dont start automatically. The status of these 5 shows “exited”. I looked at the logs for one of the containers and it doenst show anything that I can see, last few lines show waiting for connection. In the compose file for these 5 i have “restart: unless-stopped”.
Whats the best way to trouble shoot this? Thanks for any advice!
Docker has nothing to do with VMs. Only Docker Desktop uses a VM to start Linux containers inside.
In compose you need to set the restart
policy for every service, like always
or unless-stopped
, for containers to be restarted after reboot or Docker update.
Ya, my Docker Engine runs in my Ubuntu 24 VM. Also, I sure do have either “unless-stopped” or “always” in the “restart” entry. But still, 5 of the 17 containers do not start at boot.
Any advice where to look to resolve?
Check the Docker engine/daemon logs for errors if restart is set.
I read through syslog. To my untrained eye I don’t see the containers showing exiting log entries. I looked for friendly name and container ID. The 4 containers that show the “exited - code 0” status work fine when started individually. As far as I know none have dependencies. The containers that are exiting on a fresh boot are Qbittorrent, Bazarr, Radarr, and Sonarr.
syslog.txt (6.2 MB)
Does it mean you have a completely new VM and you try to automatically execute docker compose up -d
somehow and some containers don’t start, or you mean you could start the containrs, but they don’T start when you reboot?
You can find this in the logs.
ShouldRestart failed, container will not be restarted
Also
daemonShuttingDown=false error="restart canceled" execDuration=11m26.294898709s exitStatus="{0 2024-12-19 12:50:59.191115646 +0000 UTC}" hasBeenManuallyStopped=true restartCount=0
Maybe it is because
I don’t see it in the logs and I’m still not sure how to interpret the source code, but I could imagine a similar issue when a container cannot stop properly because it doesn’t handle the stop signal in time and it is killed.
There were 15 different container ID in you log, but it could be because you tried multiple times and the log may not even contain all the container IDs.
grep 'ShouldRestart' syslog.txt | awk '{print $13}' | sort | uniq | wc -l
But it doesn match the numbers you shared (17-5)