rad bicep download has no HTTP timeout and can hang indefinitely

Open Beginner friendly
#12,851 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli

Research direction

Start with DownloadToFolder in pkg/cli/bicep/tools/download_tools.go, then read the retry loop in pkg/cli/bicep/bicep.go. Run rad bicep download in a stalled-network scenario and verify that the download returns an error, allowing the existing retries to run instead of hanging indefinitely.

Written by the indexing model from the issue text.

Description

bug github-copilot triaged
Steps to reproduce
  1. Run rad bicep download (invoked automatically by deploy/install.ps1 and deploy/install.sh) in an environment where the network stalls mid-transfer while fetching the ~110MB bicep binary.
  2. The command blocks forever with no progress and no error.

This was surfaced during PR #12836 (the install.sh sudo fix): the Validate PowerShell Installer CI job repeatedly stalled at Installing bicep... and consumed its full 10-minute budget before being cancelled, with no application error in the logs.

Observed behavior

pkg/cli/bicep/tools/download_tools.go DownloadToFolder uses http.Get (the default client, which has no Timeout) followed by io.Copy on resp.Body (no read deadline). If the connection stalls after the response headers arrive, the copy blocks indefinitely.

The retry loop in pkg/cli/bicep/bicep.go only fires on returned errors, so a hang never surfaces an error and never triggers a retry — the process just hangs until an external timeout (e.g. the CI job cancellation) kills it.

Desired behavior

DownloadToFolder should use an http.Client with a sensible request timeout and/or a context deadline, so a stalled transfer fails with an error that the existing retry loop can act on, instead of hanging forever. This applies to all platforms since the download code is shared.

Workaround

A script-level mitigation was added in the PowerShell installer (bound rad bicep download with a 300s timeout so a stall warns and continues instead of hanging) in the PR that references this issue. That is only a mitigation; the root cause is the missing timeout in the shared Go download code.

rad Version

Reproduced with the released v0.60.1 rad binary in CI (edge channel).

Operating system

Surfaced on windows-2025 GitHub-hosted runners; the underlying bug is platform-independent (shared download code).

Additional context
  • Root cause: pkg/cli/bicep/tools/download_tools.go (http.Get at the DownloadToFolder GET, io.Copy on the response body).
  • Retry loop that cannot recover from a hang: pkg/cli/bicep/bicep.go.
  • Surfaced by: #12836.
Dominant language
Go
Stars
1.7k
Forks
137
Avg merge
1d 9h
Merged PRs (30d)
81

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from radius-project/radius

All issues in radius-project/radius

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.