deploy.sh reports removing netork-registry-1 on every deploy, also when it is not there #7

Closed
opened 2026-10-08 11:06:48 +00:00 by christianmanivong · 0 comments
Owner

What happens

Every deploy prints removed container netork-registry-1, even on a host where that container has long been gone. The step "Removing retired services" (deploy.sh, RETIRED_CONTAINERS, NetOrk/netork#763) echoes the line whenever docker rm -f succeeds, and docker rm -f exits 0 for a container that does not exist.

Checked on 172.22.8.50 (2026-10-08):

$ docker rm -f netork-does-not-exist-xyz >/dev/null 2>&1; echo $?
0
$ docker volume rm netork_does_not_exist_xyz >/dev/null 2>&1; echo $?
1

docker events shows no create or remove for netork-registry-1 in the hours between two deploys that both reported removing it, and no compose file on the host defines a registry service. The line is false; nothing comes back.

Why it matters

The deploy log is what we read to see what a deploy changed. A line that claims a removal on every run looks like a recurring problem (something recreating the registry), and it hides the run where a removal really happened. The volume branch is fine: docker volume rm fails for a missing volume.

Fix

Only remove, and only report, what exists:

for c in ${RETIRED_CONTAINERS}; do
  docker inspect "$c" >/dev/null 2>&1 && docker rm -f "$c" >/dev/null && echo "removed container $c"
done
## What happens Every deploy prints `removed container netork-registry-1`, even on a host where that container has long been gone. The step "Removing retired services" (deploy.sh, `RETIRED_CONTAINERS`, NetOrk/netork#763) echoes the line whenever `docker rm -f` succeeds, and `docker rm -f` exits 0 for a container that does not exist. Checked on 172.22.8.50 (2026-10-08): ``` $ docker rm -f netork-does-not-exist-xyz >/dev/null 2>&1; echo $? 0 $ docker volume rm netork_does_not_exist_xyz >/dev/null 2>&1; echo $? 1 ``` `docker events` shows no create or remove for `netork-registry-1` in the hours between two deploys that both reported removing it, and no compose file on the host defines a registry service. The line is false; nothing comes back. ## Why it matters The deploy log is what we read to see what a deploy changed. A line that claims a removal on every run looks like a recurring problem (something recreating the registry), and it hides the run where a removal really happened. The volume branch is fine: `docker volume rm` fails for a missing volume. ## Fix Only remove, and only report, what exists: ```sh for c in ${RETIRED_CONTAINERS}; do docker inspect "$c" >/dev/null 2>&1 && docker rm -f "$c" >/dev/null && echo "removed container $c" done ```
christianmanivong added the
prio
P4
component/backend
labels 2026-10-08 11:06:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NetOrk/deploy#7