Skip to content

Fix srv1 deploy main-red: shell.Exec.Run script receiver sh -> bash (pipefail) - #6746

Merged
briansrls merged 1 commit into
mainfrom
fix/deploy-run-bash-receiver
Jul 16, 2026
Merged

briansrls merged 1 commit into
mainfrom
fix/deploy-run-bash-receiver

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Symptom (main-red, operator-flagged)

deploy_dashboard_srv1 fails on main after #6711:

[shell] sh -s
[shell] done exit=2 ... sh: 1: set: Illegal option -o pipefail
host_effect_apply: shell exec returned a nonzero exit code; fail-closed

Root cause

#6711 fixed the deploy E2BIG by routing the script through stdin (sh -s) instead of embedding it in argv. That let the script actually run — exposing the next bug: the live_deploy apply script uses set -euo pipefail (emit.dag:73,120), a bash builtin option. sh -s runs it under /bin/sh = dash on srv1, which rejects -o pipefail → exit 2 → host_effect_apply fail-closed → red.

It's a §3 receiver fork: the ssh path already declares the script receiver as bash -s (ssh_exec_script_remote_receiver), but the local Run transport used sh -s. This dissolves the fork — Run → ["bash", "-s"], one script receiver for both paths. Check stays sh -c (short POSIX probes, no pipefail).

Proven by execution

  • Direct: printf 'set -euo pipefail\necho ok' | sh -s → Illegal option -o pipefail; | bash -s → ok.
  • Witness shell_exec_run_argv_embed_witnesses extended: asserts the apply script requires bash (contains pipefail) and Run uses ["bash", "-s"] (not ["sh", "-s"]). GREEN on the fix; FAIL when reverted to sh -s (discriminating RED control, verified locally).

🤖 Generated with Claude Code

…pipefail)

#6711 fixed the deploy E2BIG by routing the script through stdin (sh -s), which
let the script actually RUN — exposing the next bug: the live_deploy apply script
uses `set -euo pipefail` (emit.dag:73,120), a bash builtin option. `sh -s` runs it
under /bin/sh = dash on srv1, which rejects `-o pipefail`:
  sh: 1: set: Illegal option -o pipefail
-> exit 2 -> host_effect_apply fail-closed -> deploy_dashboard_srv1 red on main.

Root: a §3 receiver fork — the ssh path already declares the script receiver as
`bash -s` (ssh_transport_witness_test.dag ssh_exec_script_remote_receiver), but the
local Run transport used `sh -s`. Dissolve the fork: Run -> `["bash", "-s"]`, one
script receiver for both paths. (Check stays `sh -c` — it runs short POSIX probes,
not pipefail scripts.)

Proven by execution:
- Direct: printf 'set -euo pipefail\necho ok' | sh -s  => Illegal option -o pipefail
                                              | bash -s => ok
- Witness shell_exec_run_argv_embed_witnesses extended: asserts the apply script
  requires bash (contains pipefail) AND Run uses `["bash", "-s"]` and not `["sh","-s"]`.
  GREEN on the fix; FAIL when reverted to sh -s (discriminating RED control).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@briansrls
briansrls merged commit 912ce37 into main Jul 16, 2026
3 checks passed
@briansrls
briansrls deleted the fix/deploy-run-bash-receiver branch July 16, 2026 14:12
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