Skip to content

Install silently fails on curl 429/403 due to missing pipefail in curl|bash pipeline #1136

@prql-bot

Description

@prql-bot

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions