Description
When curl fails to download the install script (e.g., HTTP 429 rate limit), installClaudeCode() reports success because the curl | bash pipeline doesn't propagate curl's exit code. This causes the action to skip its retry logic and proceed to marketplace/plugin installation, which then fails with Executable not found in $PATH: "claude".
Root cause
In src/entrypoints/run.ts, the install command is:
spawn("bash", ["-c", `curl -fsSL https://claude.ai/install.sh | bash -s -- ${claudeCodeVersion}`])
In a bash pipe, the exit code is from the last command (bash -s), not curl. When curl gets a 429 (or 403), it exits non-zero, but bash -s receives empty/error input, does nothing, and exits 0. The pipefail option is not set, so the pipeline reports success.
The action has 3-attempt retry logic, but it never triggers because the first attempt appears to succeed.
Reproduction
This occurred in https://github.com/PRQL/prql/actions/runs/23827307717:
Installing Claude Code v2.1.89...
Installation attempt 1...
curl: (22) The requested URL returned error: 429
Claude Code installed successfully
[...]
##[error]Action failed with error: Failed to add marketplace '...': Executable not found in $PATH: "claude"
A successful run (https://github.com/PRQL/prql/actions/runs/23827641713) 13 minutes later shows the expected output with actual binary download and Location: ~/.local/bin/claude.
Suggested fix
Add pipefail so curl failures propagate:
- `curl -fsSL https://claude.ai/install.sh | bash -s -- ${claudeCodeVersion}`
+ `set -o pipefail; curl -fsSL https://claude.ai/install.sh | bash -s -- ${claudeCodeVersion}`
Or download-then-execute to avoid the pipe entirely:
curl -fsSL https://claude.ai/install.sh -o /tmp/install-claude.sh && bash /tmp/install-claude.sh ${claudeCodeVersion}
Adding a post-install verification (which claude || exit 1) would also help catch edge cases.
Related
This is the same underlying bug as #1091 (which reported a 403 variant). That issue was closed but the pipeline error propagation wasn't fixed.
Description
When
curlfails to download the install script (e.g., HTTP 429 rate limit),installClaudeCode()reports success because thecurl | bashpipeline doesn't propagate curl's exit code. This causes the action to skip its retry logic and proceed to marketplace/plugin installation, which then fails withExecutable not found in $PATH: "claude".Root cause
In
src/entrypoints/run.ts, the install command is:In a bash pipe, the exit code is from the last command (
bash -s), notcurl. When curl gets a 429 (or 403), it exits non-zero, butbash -sreceives empty/error input, does nothing, and exits 0. Thepipefailoption is not set, so the pipeline reports success.The action has 3-attempt retry logic, but it never triggers because the first attempt appears to succeed.
Reproduction
This occurred in https://github.com/PRQL/prql/actions/runs/23827307717:
A successful run (https://github.com/PRQL/prql/actions/runs/23827641713) 13 minutes later shows the expected output with actual binary download and
Location: ~/.local/bin/claude.Suggested fix
Add
pipefailso curl failures propagate:Or download-then-execute to avoid the pipe entirely:
Adding a post-install verification (
which claude || exit 1) would also help catch edge cases.Related
This is the same underlying bug as #1091 (which reported a 403 variant). That issue was closed but the pipeline error propagation wasn't fixed.