bazel: Remote cache + disk cache requests incorrect action keys

Description of the problem / feature request:

Using bazel 0.25.0rc2 with the new remote + disk cache feature https://github.com/bazelbuild/bazel/pull/7512 the cache requests to the remote server are prefixed with ac_ when they should be the sha of the object being requested.

If the remote cache you’re using validates this, it can result in a cache miss when it shouldn’t.

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

bazel build some-target --remote_http_cache=http://some.remote.cache --disk_cache=/some/disk/cache

Where the remote cache is https://github.com/buchgr/bazel-remote

In this case you get many warnings:

WARNING: Reading from Remote Cache:
400 Bad Request
Resource name must be a SHA256 hash in hex. Got '/cas/ac_2d1692c6da631a61480bd32a3d8ab8234bf9e5dcd3c3cfa78d388578e2a8b3cf'.

Since the cache is validating the format of the keys.

What operating system are you running Bazel on?

macOS

What’s the output of bazel info release?

release 0.25.0rc2

Have you found anything relevant by searching the web?

The warning is coming from this logic: https://github.com/buchgr/bazel-remote/blob/8811a77bfd9f8a35e4c23e758c9c585edb76283d/server/http.go#L62-L67

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (17 by maintainers)

Commits related to this issue

Most upvoted comments

@buchgr any thoughts here? It would be nice if we could get a fix in for 0.26.0 if possible