Open navkast opened 1 year ago
Hey everybody,
I ran into this issue too, and started thinking about how to fix it. It seems like the simplest way to handle a redirect given the existing abstractions is to treat it like an authentication timeout e.g. add a new else if
case somewhere around https://github.com/bazelbuild/bazel/blob/release-7.0.0-pre.20230816.3rc1/src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java#L550 wherein a new DownloadCommand
is constructed with the server-provided location and the pipeline is run again. Does this approach make sense?
Would y'all accept a contribution which fixes the issue in this way?
Thanks!
Hi everyone,
We ran into this issue as well where the server sent a 301
but bazel would complain and not upload / download any blobs with warning Remote Cache: 301 Moved Permanently
.
Checking here if this is an easy fix where the HTTP client would handle this internally as mentioned in https://github.com/bazelbuild/bazel/issues/5131.
Thank you!
Description of the feature request:
If the cache backend responds with a 302 redirect (like Artifactory sometimes does), remote cache fetches are considered failed.
This seems to stem from here: https://github.com/bazelbuild/bazel/blob/release-6.1.0/src/main/java/com/google/devtools/build/lib/remote/http/HttpDownloadHandler.java#L96
What underlying problem are you trying to solve with this feature?
JFrog and other hosted artifact providers use redirects to automatically fetch files from the closest geographical location. You could also use this for S3 signed URLs.
Which operating system are you running Bazel on?
MacOS Apple Silicon Ventura 13.2.1
What is the output of
bazel info release
?release 6.1.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
Similar issue: https://github.com/bazelbuild/bazel/issues/5131 Code from eons ago that fixed this during those days: https://github.com/bazelbuild/bazel/pull/5258 Gradle supports build cache redirects as of 2021: https://github.com/gradle/gradle/pull/17390
Any other information, logs, or outputs that you want to share?
Here is a full stacktrace: