An Azure service that provides cloud-scale job scheduling and compute management.
Demeusy, Valentin hi, thx for sharing urs issue here at Q&A portal,
Looks like Batch/Shipyard is trying to start the task container again, but Docker still has the old container with the same name on the node.
That usually happens when the task gets interrupted/retried, the node reboots, Docker daemon restarts, Batch thinks the task needs to start again, but the previous container wasn’t removed cleanly. Then Docker refuses bc container names must be unique.
Since it happens after some hours, I’d check task retry count, max wall clock time, node reboot events, Docker daemon logs, and Batch node events. If stdout gets cleared, that’s another clue the task attempt may have restarted, not just crashed inside ur code.
Quick thing: make sure the container is run with auto-remove behavior or unique container names per attempt if Batch Shipyard lets u set it. If the name is fixed per task, retries can collide with stale containers.
On an affected node, before cleanup, run
docker ps -a
docker inspect <container-id>
journalctl -u docker --since '10 hours ago'
Worth checking Batch task execution info too, esp retryCount, exitCode, failureInfo, and previous attempts https://learn.microsoft.com/en-us/azure/batch/batch-retry-task
Batch Shipyard may also be part of the story here, bc it generates/manages Docker names. If it uses deterministic names and the cleanup path fails, long-running retries can hit exactly this.
Workaround rn: disable/limit retries while testing, use unique task IDs/container names, or add a cleanup step that removes the old container before start:
docker rm -f <container-name> || true
Not beautiful, but it proves the stale-container theory fast.
My guess: task/node restart + stale Docker container, not Azure Batch randomly running the same task twice on purpose.
rgds,
Alex
&
If my answer was helpful pls mark it and additional thx if u follow me at Q&A portal