bazelbuild / bazelisk

A user-friendly launcher for Bazel.
Apache License 2.0
2.05k stars 316 forks source link

Bazelisk fails with TLS handshake timeout on WSL2 #476

Open andreas-0815-qwertz opened 1 year ago

andreas-0815-qwertz commented 1 year ago

Whenever I run bazel through bazelisk (I tried 1.16.0 and 1.17.0), I get the following error:

2023/06/26 15:03:56 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

even, if I just try to execute bazel clean.

I am on WSL2 on a Windows machine, which accesses the web through a ZScaler proxy. As wget https://www.googleapis.com/storage/v1/b/bazel/o?delimiter=/ just works fine without any issues, I do not think it is a general proxy issue.

I am rather suspecting a certificate issue. While my system has the necessary root certificate for ZScaler middleman in /etc/ssl/cert (as witnessed by the wget-command), I doubt whether bazelisk uses this certificate. But I am not enough of a golang programmer to really know.

andreas-0815-qwertz commented 1 year ago

Btw., creating a .bazelversion works around this issue for me.

andreas-0815-qwertz commented 1 year ago

Forgot to mention that setting BAZELISK_BASE_URL does not help here, as listDirectoriesInReleaseBucket does not seem to use it.