Skip to content

ci/deploy: retry go mod download on Go proxy stream errors #1723

Closed

Description

@cristim

Problem

Go module downloads from the public Go proxy intermittently fail with an HTTP/2 stream reset, for example:

go: <module>@<version>: read "https://proxy.golang.org/<module>/@v/<version>.zip": stream error: stream ID 1; INTERNAL_ERROR; received from peer

There is no retry, so one dropped stream fails the whole job. It happened three times on platform on 2026-11-04, each time on unrelated changes:

Run Workflow / job Step Commit
41826279560 CI - Build & Test / Lint Code golangci-lint typecheck (module fetch) PR #1706 head
41867247845 CI - Build & Test / Build Docker Image (arm64) Docker RUN go mod download main 28dc544
41867487865 Deploy to AWS Lambda / Build & Deploy Terraform docker_build local-exec: RUN go mod download main 6afd546

A re-run of the failed jobs passed each time. The deploy failure leaves main's latest deploy red until the next push.

Proposal

Add a small bounded retry around go mod download wherever modules are fetched:

  • Dockerfile:47 and Dockerfile.dev:30. For example RUN for i in 1 2 3; do go mod download && break; [ $i = 3 ] && exit 1; sleep $((i * 5)); done, or a tiny shared script.
  • .github/workflows/ci.yml:306-307 (the per-module go mod download && go mod verify loop). Retry the download only; keep go mod verify single-shot, so a checksum mismatch still fails at once.
  • Optionally, prefetch modules with the same retry before the golangci-lint step, so its typecheck doesn't fetch on its own.

Keep it bounded (3 attempts with a short backoff). A real resolution or checksum error must still fail the job. Precedent: #74 added a bounded retry for govulncheck's vuln-DB fetch.

Not in scope

Changing proxies, GOPROXY/GOFLAGS settings, or module pins.

Activity

  1. added a commit that references this issue on Nov 5, 2026
    8090068
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions