Summary
Several marvel CLI commands print Error: ... to stderr but return exit code 0. Shell scripts and CI pipelines that key off exit codes will miss the failure.
Observed
marvel work with preflight failure
$ marvel --cluster desk work /tmp/preflight.yaml; echo "exit: $?"
Error: runtime pre-flight failed on 1 role(s):
team[0=broken].role[0=ghost]: command "/nonexistent/binary": not found: stat /nonexistent/binary: no such file or directory
Usage:
marvel work <manifest.toml> [flags]
...
exit: 0
marvel events against a daemon that doesn't expose the RPC
A pre-PR #25 daemon responds with Error: unknown method: events — but:
$ marvel events -n 5; echo "exit: $?"
Error: unknown method: events
Usage: ...
exit: 0
Expected
Exit code non-zero (idiomatically 1) when the command prints Error:. The Usage trailer after Error: suggests cobra's default error handling is routing through SilenceUsage: false but swallowing the return.
Likely cause
cobra's RunE returning an error should propagate to exit 1 via cmd.Execute() in cmd/marvel/main.go. Either:
main.go isn't checking Execute()'s return
- A command is printing the error itself and returning nil
SilenceErrors/SilenceUsage interaction is masking it
Test
After fix: marvel work /tmp/nonexistent-manifest.yaml; echo $? should print a non-zero code.
Environment
- marvel 0.1.0-alpha.20260419.014522.b8f1f4b (commit b8f1f4b)
- Linux aarch64, both mrvl:// and Unix socket paths reproduce
Summary
Several
marvelCLI commands printError: ...to stderr but return exit code 0. Shell scripts and CI pipelines that key off exit codes will miss the failure.Observed
marvel workwith preflight failuremarvel eventsagainst a daemon that doesn't expose the RPCA pre-PR #25 daemon responds with
Error: unknown method: events— but:Expected
Exit code non-zero (idiomatically 1) when the command prints
Error:. The Usage trailer afterError:suggests cobra's default error handling is routing throughSilenceUsage: falsebut swallowing the return.Likely cause
cobra's
RunEreturning an error should propagate to exit 1 viacmd.Execute()incmd/marvel/main.go. Either:main.goisn't checkingExecute()'s returnSilenceErrors/SilenceUsageinteraction is masking itTest
After fix:
marvel work /tmp/nonexistent-manifest.yaml; echo $?should print a non-zero code.Environment