Repository navigation
fix: propagate command exit code instead of swallowing failures - #11
Merged
Merged
Conversation
execFileSync throws on a non-zero exit, but the catch block printed the error and returned, so the process exited 0 even when docker compose (and the command it ran) failed. Callers such as Ansible and Woodpecker then saw a successful run. Exit with the underlying command's status code, and exit non-zero when the env file is missing. This is the only command-execution path; it is a passthrough for all docker compose subcommands (run, exec, up, pull, ...), so the fix covers every command the wrapper runs.
This was referenced Jun 16, 2026
Closed
cableman
approved these changes
Jun 16, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: https://leantime.itkdev.dk/#/tickets/showTicket/6227
Failed
docker composecommands were reported as successful, which is the root cause of Woodpecker deploys going green despite real failures (e.g.pre-updrush commands failing, or containers not coming online).Changes
modules/docker.ts: on a non-zero exit fromdocker compose, exit with the underlying command's status code instead of catching the error and returning.commands/docker.ts: exit non-zero when the env file is missing.[Unreleased].Why
execFileSyncthrows when the child exits non-zero, but thecatchblock only printed the message and returned, so the wrapper process exited0. Ansible'sshell/commandtasks therefore sawrc=0, the play reportedfailed=0, and Woodpecker marked the job successful.docker.exec()is the wrapper's only command-execution path — a passthrough for everydocker composesubcommand (run,exec,up,pull, …) — so this single fix covers all commands the wrapper runs.Note
The deployed
assets/itkdev-docker-compose-serverbinary is rebuilt from source by the release workflow on tag push. After merge, a tagged release and a redeploy of the binary to the servers are required for the fix to take effect.