Skip to content

BES sending invalid authority headers when using --bes_backend=unix:// #23417

Open
@BryceBeagle

Description

@BryceBeagle

Description of the bug:

When Bazel is configured to use a unix:// endpoint for the BES backend (--bes_backend=unix://xyz.sock), it sends the socket path as the authority. This is an invalid authority and some HTTP2 servers, such as h2, (rightfully) reject it.

[2024-08-24T18:02:06Z DEBUG h2::server] malformed headers: malformed authority (b"/var/folders/19/9rpslp2162z1pt_3vn2dw_fm0000gn/T/.tmpvRc94o.sock"): invalid uri character
[2024-08-24T18:02:06Z DEBUG h2::codec::framed_read] received frame=Data { stream_id: StreamId(3), flags: (0x1: END_STREAM) }
[2024-08-24T18:02:06Z DEBUG h2::codec::framed_write] send frame=Reset { stream_id: StreamId(3), error_code: PROTOCOL_ERROR }

This issue is discussed in detail in

As a workaround I am using hyperium/h2#487 to force h2 to be less strict, but this should be fixed on Bazel's side.

I'm not sure where Bazel is constructing its GRPC requests, but it prevents using an h2 server as a BES backend when using Unix sockets. There was a change made a while back to grpc-go to resolve this; please let me know if I should open an issue with grpc-java instead.

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.

Point bes_backend=unix:// at an h2/tonic server

Which operating system are you running Bazel on?

MacOS

What is the output of bazel info release?

release 7.1.1

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 ?

No response

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?

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions