Skip to content

Fix chamber exec failing on --trace flag#11660

Merged
nbudin merged 1 commit into
mainfrom
fix-oidc-chamber-exec
Jun 9, 2026
Merged

Fix chamber exec failing on --trace flag#11660
nbudin merged 1 commit into
mainfrom
fix-oidc-chamber-exec

Conversation

@nbudin

@nbudin nbudin commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Purpose

Two more fixes for the deployment/release-command flow, following on from the OIDC token work.

Chamber 3.1.5 uses cobra for CLI parsing, and cobra has a known quirk where it consumes --trace even after the -- argument separator. So chamber exec SERVICE -- bundle exec rails release:perform --trace was failing with Error: unknown flag: --trace. The fix is just to drop --trace from the release_command in fly.toml — it's a Rails debug flag that's not useful in production anyway.

While in here, I also replaced the su --preserve-environment approach in drop_to_www() with gosu. gosu exec's directly without spawning an intermediate shell, which is cleaner and sidesteps any argument-mangling in the shell invocation layer. This also removes the need to install gosu separately — it's in the Debian package repos.

Changes

  • fly.toml: remove --trace from release_command
  • bin/entrypoint.sh: replace su --preserve-environment with exec gosu www "$@"
  • Dockerfile: add gosu to the apt-get install line

🤖 Generated with Claude Code

Two fixes for the deployment/release-command flow:

1. Remove --trace from the release_command in fly.toml. Chamber uses
   cobra for CLI parsing, and cobra consumes --trace even after the --
   separator, causing "Error: unknown flag: --trace" on every release.

2. Replace the su --preserve-environment approach in drop_to_www() with
   gosu. gosu exec's directly without an intermediate shell layer, which
   is cleaner and avoids any argument-mangling when passing commands
   through the privilege drop. Install gosu via apt in the Dockerfile.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nbudin nbudin marked this pull request as ready for review June 9, 2026 04:41
@nbudin nbudin merged commit 0c064d1 into main Jun 9, 2026
13 checks passed
@nbudin nbudin deleted the fix-oidc-chamber-exec branch June 9, 2026 04:42
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
Overall Coverage 🟢 52.92% 🟢 52.92% ⚪ 0%

Minimum allowed coverage is 0%, this run produced 52.92%

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