Skip to content

Fix OIDC token fetch error swallowing in entrypoint.sh#11655

Merged
nbudin merged 1 commit into
mainfrom
fix-oidc-entrypoint-error-handling
Jun 9, 2026
Merged

Fix OIDC token fetch error swallowing in entrypoint.sh#11655
nbudin merged 1 commit into
mainfrom
fix-oidc-entrypoint-error-handling

Conversation

@nbudin

@nbudin nbudin commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Purpose

The deployment was failing because the www user can't access /.fly/api — the Unix socket is owned by root.

First pass (previous commit) improved the error message by replacing the opaque JSONDecodeError with an explicit check. That confirmed the root cause: empty response = permission denied, not a bad endpoint.

This commit fixes the actual problem. USER www is removed from the Dockerfile before ENTRYPOINT so the script starts as root and can successfully reach /.fly/api. After fetching and writing the OIDC token, the script drops to the www user via su --preserve-environment before exec'ing chamber or the app command. The token file is chown'd to www first so chamber can read AWS_WEB_IDENTITY_TOKEN_FILE after the privilege drop.

The drop_to_www helper also handles the case where the entrypoint is already running as www (e.g. local testing), so nothing breaks in that path.

🤖 Generated with Claude Code

-sf caused curl to exit silently on any failure (connection error,
HTTP 4xx/5xx), producing empty stdout. Python then got empty stdin
and crashed with an opaque JSONDecodeError instead of a useful message.

Drop -f, capture the response in a variable, and emit actionable error
messages when the response is empty or not valid JSON.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nbudin nbudin marked this pull request as ready for review June 9, 2026 03:55
@nbudin nbudin merged commit 7f6dad5 into main Jun 9, 2026
12 checks passed
@nbudin nbudin deleted the fix-oidc-entrypoint-error-handling branch June 9, 2026 03:55
@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