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.
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 FoundCommon 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
- Set
.bazelversionto a released version that exists. - Commit it so local and CI resolve the same Bazel.
- Re-run so Bazelisk downloads a valid release.
7.4.1Provide a GitHub token for the API
Give Bazelisk an authenticated token so release lookups are not rate limited in CI.
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.