Bazel repository rule download failed (network) in CI
A repository rule (http_archive, git_repository) could not download its artifact. Often transient network failure; sometimes a moved URL or wrong checksum.
What this error means
External setup fails with "Error downloading [url] to ...: <network error>" or a checksum mismatch, before any target is built.
bazel
ERROR: An error occurred during the fetch of repository 'rules_go':
java.io.IOException: Error downloading
[https://example.com/rules_go.tar.gz] to /root/.cache/...: Connection timed outCommon causes
Transient network failure
A timeout or reset while downloading the archive; a retry usually succeeds.
URL moved or unreachable
The artifact URL changed or the host is blocked from the runner network.
Checksum mismatch
The sha256 in the rule does not match the downloaded file, so Bazel rejects it.
How to fix it
Add retries and mirror URLs
- Provide multiple urls and let Bazel retry transient failures.
.bazelrc
# .bazelrc
build --experimental_repository_downloader_retries=3Fix the URL or checksum
- Update the moved URL, or recompute and pin the correct sha256.
WORKSPACE
http_archive(name = "rules_go", sha256 = "<correct>", urls = ["<url>"])How to prevent it
- Self-healing managed runners like Latchkey auto-retry transient download failures, and a stable network plus mirror URLs keeps external fetches reliable for heavy monorepo builds.
Related guides
Bazel remote cache connection failed (transient) in CIFix Bazel remote cache connection failures in CI. A transient network or auth blip to the gRPC/HTTP cache bac…
Bazel WORKSPACE / MODULE.bazel error in CIFix Bazel WORKSPACE / MODULE.bazel resolution errors in CI. A bazel_dep, version, or registry problem stopped…
Bazel "Build did NOT complete successfully" in CIFix Bazel "ERROR: Build did NOT complete successfully" in CI. This summary line follows the real failure - re…