Skip to content
Latchkey

Bazel ".bazelversion" / Bazelisk version not found in CI

Bazelisk reads .bazelversion to pick which Bazel to download. When that version string does not correspond to a real release (a typo or a yanked version), Bazelisk cannot fetch a binary and the build never starts.

What this error means

A build fails before any target with a Bazelisk error that it could not download the requested Bazel version, often a 404 for the release artifact named in .bazelversion.

Bazel
could not download Bazel: HTTP GET https://releases.bazel.build/7.9.9/release/...
returned status code 404

Common causes

The pinned version does not exist

The string in .bazelversion (for example 7.9.9) is not a published release, so Bazelisk gets a 404 fetching it.

A typo or malformed version line

Trailing whitespace, a stray prefix, or a non-version value in .bazelversion makes Bazelisk request a nonexistent artifact.

How to fix it

Pin a real, published version

  1. Set .bazelversion to an actual Bazel release (just the version number, no extra characters).
  2. Commit the corrected file.
  3. Re-run so Bazelisk downloads the matching binary.
.bazelversion
7.4.1

Cache the Bazelisk download

Persist the Bazelisk cache so a previously downloaded version is reused and not refetched each run.

.github/workflows/ci.yml
- uses: actions/cache@v4
  with:
    path: ~/.cache/bazelisk
    key: bazelisk-${{ hashFiles('.bazelversion') }}

How to prevent it

  • Keep .bazelversion set to a published release with no stray characters.
  • Bump it deliberately and verify the version exists.
  • Cache the Bazelisk download directory between runs.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →