Skip to content

Bazel commands fail when behind a Proxy #14896

@adamawolf

Description

@adamawolf

Description of the problem / feature request:

When running local proxy software such as ProxyMan or Charles Proxy bazel commands fail with errors like:

Proxy address 127.0.0.1:9090 is not a valid URL

Also, once such an error occurs, only a bazel clean -expunge will mend the development environment (even after you disconnect from the Proxy).

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

Set up a local proxy, and run any bazel command which requires fetching remote artifacts.

What operating system are you running Bazel on?

macOS Big Sur 11.6.2

What's the output of bazel info release?

release 5.0.0

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

bdcc080
bdcc080

Have you found anything relevant by searching the web?

This response from @kchodorow to a now closed issue #2375 (comment) stating that bazel does not support the "no proxy" environment variable yet, and java treats localhost and 127.* addresses as non-proxied. I don't know what the environment variable she mentioned pertains to (maybe it's supported now?). I'm also unclear if the comment about java treating as non-proxied is relevant. Is the implication that did this not explicitly fail here in the regex parsing, then bazel's downloader would fail further down the line? I'm going to go ahead and create a PR for how I think the regex should be adjusted to permit protocol-less addresses, and then test this in my environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)team-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions