Skip to content

Retry transient failures when downloading a pre-built canister wasm #890

Open

Description

@guryanov-a

Problem

icp build downloads the wasm of a type: pre-built canister with a url in a single request (crates/icp-app/src/wasm.rs#L140), with no retry. When the connection drops while the body is being read, the build stops:

failed to read http response

Fetching the same URL with curl right afterwards works, and running the build again succeeds. Projects that pull several pre-built canisters (for example the ICP ledger and index wasms from GitHub releases) hit this often enough that we replaced pre-built with a type: script step that runs curl with --retry.

Proposal

Retry a failed pre-built download a few times with a short backoff. Cover connection errors, 5xx responses, and failures while reading the response body, not only failures to connect.

Environment

  • icp-cli 1.8.0 (first seen on 0.3.2)
  • macOS arm64

Written by Claude Opus 5.5 in Claude Code

Activity

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