Skip to content
Latchkey

Bazelisk "could not download Bazel" (.bazelversion) in CI

Bazelisk reads the version in .bazelversion and downloads that exact Bazel release before running any command. When the download fails, from a nonexistent version, network trouble, or a rate-limited GitHub API, no build can start.

What this error means

CI fails at startup with "could not download Bazel ..." or "Downloading https://releases.bazel.build/...: could not download" naming the version from .bazelversion.

bazelisk
2026/06/30 10:11:12 Downloading https://releases.bazel.build/7.9.9/release/
bazel-7.9.9-linux-x86_64...
could not download Bazel: HTTP GET ... returned 404 Not Found

Common causes

The pinned version does not exist

A typo or unreleased version in .bazelversion gives Bazelisk a URL that returns 404, so nothing downloads.

Network or GitHub API rate limiting

A blocked egress or an unauthenticated, rate-limited GitHub API call prevents Bazelisk from resolving or fetching the release.

How to fix it

Pin a real Bazel version

  1. Set .bazelversion to a released version that exists.
  2. Commit it so local and CI resolve the same Bazel.
  3. Re-run so Bazelisk downloads a valid release.
.bazelversion
7.4.1

Provide a GitHub token for the API

Give Bazelisk an authenticated token so release lookups are not rate limited in CI.

.github/workflows/ci.yml
env:
  BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

How to prevent it

  • Pin .bazelversion to a released version and commit it.
  • Set BAZELISK_GITHUB_TOKEN so API lookups are not rate limited.
  • Cache the Bazelisk download directory across CI runs.

Frequently asked questions

What causes ""could not download Bazel""?
A typo or unreleased version in .bazelversion gives Bazelisk a URL that returns 404, so nothing downloads.
How do I fix "could not download Bazel"?
Pin a real Bazel version

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card