Skip to content

fix: mcc infra run silently swallows docker compose failures - #60

Open
dogfootman wants to merge 1 commit into
developfrom
fix/mcc-infra-run-exit-code
Open

fix: mcc infra run silently swallows docker compose failures#60
dogfootman wants to merge 1 commit into
developfrom
fix/mcc-infra-run-exit-code

Conversation

@dogfootman

@dogfootman dogfootman commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • common.SysCall discarded docker compose up's exit code, so mcc infra run always returned 0 even when Compose aborted the startup graph partway through (e.g. a service failing its healthcheck). installAll.sh could never detect this, leaving unrelated services stuck in Created state with no error reported and mc-iam-manager-post-initial silently never running.
  • run.go now uses RunE + common.SysCallWithError (already used elsewhere in the codebase) so the real exit code propagates, and sets SilenceUsage to avoid dumping help text on runtime failures.
  • installAll.sh brings the stack up in staged waves (core infra → data/web → observability backbone → app tier) instead of one monolithic call, checks each wave's exit code immediately and names the failing wave/service, and points to the existing iam_manager_init.sh if IAM setup didn't complete.
  • monitor_containers now uses docker ps -a so Created/Exited containers are classified as failures instead of being indistinguishable from "still pulling", and stops polling immediately instead of waiting out the full 20-minute timeout.
  • Scope intentionally limited to docker/run.go (the command installAll.sh depends on) — the same common.SysCall pattern exists in stop/remove/pull/update/info.go and the k8s package, left alone since cleanAll.sh relies on stop/remove tolerating "already stopped/removed" as non-fatal.

common.SysCall discarded docker compose up's exit code, so mcc infra run
always returned 0 even when Compose aborted the startup graph partway
through (e.g. a service failing its healthcheck). installAll.sh could
never detect this, leaving services stuck in Created state with no
error reported.

- run.go now uses RunE + SysCallWithError so the real exit code
  propagates, and sets SilenceUsage to avoid dumping help text on
  runtime failures.
- installAll.sh brings the stack up in staged waves instead of one
  monolithic call, checks each wave's exit code immediately, and
  points to iam_manager_init.sh if IAM setup didn't complete.
- monitor_containers now uses `docker ps -a` so Created/Exited
  containers are classified as failures instead of being indistinguishable
  from "still pulling", and stops polling immediately instead of waiting
  out the full 20-minute timeout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant