bug(compose): up -d --wait treats create-buckets exit(0) as failure #510

Closed
opened 2026-05-11 16:32:12 +02:00 by marcel · 0 comments
Owner

Summary

docker compose -f docker-compose.prod.yml ... up -d --wait exits non-zero even when every service is healthy, because the one-shot create-buckets service exits 0 and --wait interprets that as "not running, fail".

Reproduction (from run 1496 log)

 Container archiv-staging-db-1 Healthy
 Container archiv-staging-ocr-service-1 Healthy
 Container archiv-staging-mailpit-1 Healthy
 Container archiv-staging-minio-1 Healthy
 Container archiv-staging-backend-1 Healthy
container archiv-staging-create-buckets-1 exited (0)
  ❌  Failure - Main Deploy staging
exitcode '1': failure

Stack functionally up. Smoke step never runs because up -d --wait fails first.

Fix

  1. create-buckets: add restart: "no" to declare one-shot intent.
  2. backend.depends_on: add create-buckets: condition: service_completed_successfully.

With both in place, Docker Compose v2.20+ understands create-buckets is a one-shot that must complete successfully, and --wait treats exited(0) as the target state. The backend correctly gates startup behind bucket bootstrap (closes a latent race: backend currently starts in parallel with create-buckets even though it needs the bucket + policy to exist).

Discovered

While running nightly.yml against staging after #506/#508 unblocked the prior layers. The runtime stack is now healthy (verified via direct curl against staging.raddatz.cloud); only the workflow's own wait gate fails.

## Summary `docker compose -f docker-compose.prod.yml ... up -d --wait` exits non-zero even when every service is healthy, because the one-shot `create-buckets` service exits 0 and `--wait` interprets that as "not running, fail". ## Reproduction (from run 1496 log) ``` Container archiv-staging-db-1 Healthy Container archiv-staging-ocr-service-1 Healthy Container archiv-staging-mailpit-1 Healthy Container archiv-staging-minio-1 Healthy Container archiv-staging-backend-1 Healthy container archiv-staging-create-buckets-1 exited (0) ❌ Failure - Main Deploy staging exitcode '1': failure ``` Stack functionally up. Smoke step never runs because `up -d --wait` fails first. ## Fix 1. `create-buckets`: add `restart: "no"` to declare one-shot intent. 2. `backend.depends_on`: add `create-buckets: condition: service_completed_successfully`. With both in place, Docker Compose v2.20+ understands `create-buckets` is a one-shot that must complete successfully, and `--wait` treats `exited(0)` as the target state. The backend correctly gates startup behind bucket bootstrap (closes a latent race: backend currently starts in parallel with create-buckets even though it needs the bucket + policy to exist). ## Discovered While running `nightly.yml` against staging after #506/#508 unblocked the prior layers. The runtime stack is now healthy (verified via direct curl against staging.raddatz.cloud); only the workflow's own wait gate fails.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#510