bazelisk: could not resolve the version 'latest' to an actual version number
I download the latest version bazelist for my Mac, but it show bazelist could get bazel from GCS bucket. Here is the error messgae , how should i resolve this?
could not resolve the version 'latest' to an actual version number: unable to determine latest version: could not list Bazel versions in GCS bucket: could not list GCS objects at https://www.googleapis.com/storage/v1/b/bazel/o?delimiter=/: could not fetch https://www.googleapis.com/storage/v1/b/bazel/o?delimiter=/: Get "https://www.googleapis.com/storage/v1/b/bazel/o?delimiter=/": net/http: TLS handshake timeout
when I connect a gloable proxy, bazelist show following error message:
could not resolve the version 'latest' to an actual version number: unable to determine latest version: could not list Bazel versions in GCS bucket: could not list GCS objects at https://www.googleapis.com/storage/v1/b/bazel/o?delimiter=/: could not fetch https://www.googleapis.com/storage/v1/b/bazel/o?delimiter=/: Get "https://www.googleapis.com/storage/v1/b/bazel/o?delimiter=/": read tcp 192.168.43.5:57885->172.217.24.10:443: read: connection reset by peer
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 16 (5 by maintainers)
Commits related to this issue
- Set `.bazelversion` To avoid this issue: https://github.com/bazelbuild/bazelisk/issues/220 — committed to realm/SwiftLint by jpsim 2 years ago
- https://github.com/bazelbuild/bazelisk/issues/220 — committed to zhangm365/CPlusPlusThings by zhangm365 a year ago
I was having the same issues where setting the base url environment world didn’t seem to work. It turned out the issue was indeed that googleapis.com was blocked from my company’s network.
I set the BAZELISK_BASE_URL but that didn’t work for whatever reason, so I ended up just explicitly setting the Bazel version in the
.bazeliskrc
rather than always getting the latest.echo "USE_BAZEL_VERSION=4.1.0" > .bazeliskrc
The point is that the issue was that googleapis (which checks for latest version) is blocked, but the registry to download bazel was not. So just setting the version number worked for me.
Workaround:
echo "BAZELISK_BASE_URL=https://github.com/bazelbuild/bazel/releases/download" > .bazeliskrc
I use @keanedawg 's method ,and I finally succeed!!! Like this
it works, thx
I also use @keanedawg 's method ,and I finally succeed!!!
BTW, I have already do this, but not works. running in docker.
hi, @fweikert, I am working on ubuntu and facing the same error now, how could I solve this? thank you
Hi,
it sounds like your network is not allowing access to https://www.googleapis.com/ (with or without proxy).
Unfortunately with the current Bazelisk version it is not possible to fallback to GitHub when GCS is not available. Apparently we implemented the reverse direction (https://github.com/bazelbuild/bazelisk/commit/46d319d70558aa39a3a178a95ff18fec47dc5083) but haven’t considered that GCS might not be reachable.
I will have to think about how we could solve this in a simple way. Sorry that I can’t offer you a quick workaround 😕
Pinging @fweikert just in case he has an idea.