bazelbuild / bazelbuild/bazel

HTTP endpoints not picking up additional headers from remote_cache_header

Open
#28,960 1 comment 1 reaction 0 assignees View on GitHub
P3 team-Remote-Exec type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

--remote_cache_header does not get appended within HTTP requests like it does with gRPC

### Which category does this issue belong to?

Remote Execution

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

In one terminal run `nc -l -p 8080`

~/.netrc : `machine localhost login myuser password 456`

```
bazel build //some/small:target --remote_cache=http://localhost:8080 --remote_cache_header=Authorization=123
```

Then you can run it again with remote_header instead of remote_cache_header

### Which operating system are you running Bazel on?

MacOS & Ubuntu

### What is the output of `bazel info release`?

release 9.0.1 / release 8.4.2

### If `bazel info release` returns `development 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 HEAD` ?

```text
git@github.com:bazelbuild/bazel.git
f3ab7948c2dff519f8228890b3878a5586d2b723
```

### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

_No response_

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

TracingMetadataUtils.java merges the remoteHeader and remoteCacheHeader, but in CombinedCacheClientFactory.java (used by HTTP) you see that only remoteHeaders are passed through.

Contributor guide

Open the contributing guide

Research direction

Start with CombinedCacheClientFactory.java, which the issue identifies as the HTTP path, and compare how it passes headers with TracingMetadataUtils.java, where remoteHeader and remoteCacheHeader are merged for gRPC. Reproduce the behavior with the provided netcat command and verify that HTTP requests include the remote_cache_header value as they do for gRPC.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.