Skip to content

Add default retries for transient network failures when downloading pnpm (and optionally a retries input) #84

Open

Description

@joshunger

Summary

pnpm/setup has only partial retry coverage for network failures, so a single transient blip during setup can fail a CI job. Could the action retry downloads more robustly, or expose a retries input?

Current behavior (as of a088197, v3)

  • Version resolution (src/install-pnpm/download.ts): uses @actions/http-client with allowRetries: true, maxRetries: 3. The http-client retries only GET responses with 502/503/504. Connection-level errors (ECONNRESET, ETIMEDOUT, DNS failures) and other statuses such as 429/500 are not retried.
  • Binary download: delegated to get-pnpm (0.0.5), which calls fetch() once with no retry. This seems the most likely point of failure.
  • Runtime install: pnpm runtime set <name> <version> -g relies on pnpm's own network settings. It's unclear whether fetch-retries applies here, and the README doesn't say.

Workflow

- uses: pnpm/setup@a0881977cd8ea73b1ed212236c99ca10dcc80cf4 # v3
  with:
    node-version-file: ".node-version"
    install: false

Proposal

  1. Retry the pnpm binary download (in get-pnpm or around the call) with exponential backoff, covering network errors as well as 429/5xx responses.
  2. Extend version-resolution retries to cover connection errors and 429.
  3. Optionally, add a retries input (or document that pnpm_config_fetch_retries applies to pnpm runtime set).

Workaround

Today, users have to duplicate the step with continue-on-error: true and a conditional second attempt, because GitHub Actions has no step-level retry for uses: steps.

Activity

  1. joshunger commented on Oct 20, 2026

    @joshunger
    Author
    2026-10-20T15:17:44.6110800Z ##[group]Installing pnpm...
    2026-10-20T15:17:44.6115597Z Downloading pnpm 12.14.0 from https://registry.npmjs.org/
    2026-10-20T15:17:44.7485279Z ==> Downloading pnpm 12.14.0
    2026-10-20T15:17:45.2740936Z ##[endgroup]
    2026-10-20T15:17:45.2742260Z Error: Could not download https://registry.npmjs.org/pnpm/12.14.0: 502 Bad Gateway
    2026-10-20T15:17:45.2742839Z     at Z$ (/home/runner/_work/_actions/pnpm/setup/a0881977cd8ea73b1ed212236c99ca10dcc80cf4/dist/index.js:249:2470)
    2026-10-20T15:17:45.2743665Z     at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    2026-10-20T15:17:45.2744216Z     at async X$ (/home/runner/_work/_actions/pnpm/setup/a0881977cd8ea73b1ed212236c99ca10dcc80cf4/dist/index.js:249:2157)
    2026-10-20T15:17:45.2745031Z     at async /home/runner/_work/_actions/pnpm/setup/a0881977cd8ea73b1ed212236c99ca10dcc80cf4/dist/index.js:254:1707
    2026-10-20T15:17:45.2745614Z     at async Promise.allSettled (index 1)
    2026-10-20T15:17:45.2746186Z     at async Uxe (/home/runner/_work/_actions/pnpm/setup/a0881977cd8ea73b1ed212236c99ca10dcc80cf4/dist/index.js:254:703)
    2026-10-20T15:17:45.2746869Z     at async s8 (/home/runner/_work/_actions/pnpm/setup/a0881977cd8ea73b1ed212236c99ca10dcc80cf4/dist/index.js:254:316)
    2026-10-20T15:17:45.2747449Z     at async o8 (/home/runner/_work/_actions/pnpm/setup/a0881977cd8ea73b1ed212236c99ca10dcc80cf4/dist/index.js:256:156)
    2026-10-20T15:17:45.2748030Z     at async Vxe (/home/runner/_work/_actions/pnpm/setup/a0881977cd8ea73b1ed212236c99ca10dcc80cf4/dist/index.js:260:1915)
    2026-10-20T15:17:45.2748606Z     at async $xe (/home/runner/_work/_actions/pnpm/setup/a0881977cd8ea73b1ed212236c99ca10dcc80cf4/dist/index.js:270:433)
    2026-10-20T15:17:45.2752064Z ##[error]Error: Could not download https://registry.npmjs.org/pnpm/12.14.0: 502 Bad Gateway
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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