bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Bazel commands fail when behind a Proxy

Open adamawolf opened this issue 4 years ago • 0 comments

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 ?

bdcc0800b2b8864396fb53c94cfb481f16854607 bdcc0800b2b8864396fb53c94cfb481f16854607

Have you found anything relevant by searching the web?

This response from @kchodorow to a now closed issue https://github.com/bazelbuild/bazel/issues/2375#issuecomment-303508135 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.

adamawolf avatar Feb 24 '22 05:02 adamawolf