Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy settings by --docker-env http_proxy fails with percent encoded chars #3812

Closed
2 of 3 tasks
MichtToen opened this issue Mar 6, 2019 · 8 comments
Closed
2 of 3 tasks
Labels
area/networking networking issues good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.

Comments

@MichtToen
Copy link

MichtToen commented Mar 6, 2019

If this is a bug report, please include:

  • How to replicate the error, including the exact command-lines used.
  • The full output of the command that failed
  • The operating system name and version used
@MichtToen
Copy link
Author

MichtToen commented Mar 6, 2019

At last with the windows version:

If you are behind a proxy and your auth name is for example an email, like "user@example.com", you will have an proxy settings like this:

http_proxy=http://user%40example.com:password@proxy.com:8080

The "%40" is the needed and a legal url encoded part-

If you call now

minikube start --docker-env HTTP_PROXY=http://user%40example.com:password@proxy.com:8080

the HTTP_PROXY will not be set in the created VM. Which is easily to test on another terminal with
minikube ssh
and
systemctl show --property=Environment docker

In fact every percent encode sign will fail.

To see the effect, change the request to a double @
minikube start --docker-env HTTP_PROXY=http://user@example.com:password@proxy.com:8080

and the HTTP_PROXY env will be set.

@MichtToen MichtToen changed the title Proxy settings by Proxy settings by --docker-env http_proxy fails with percent encoded chars Mar 6, 2019
@MichtToen
Copy link
Author

As a note: The env var will be silent skipped, there is no error message or warning.

@tstromberg tstromberg added kind/bug Categorizes issue or PR as related to a bug. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. area/networking networking issues help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Mar 7, 2019
@tstromberg
Copy link
Contributor

tstromberg commented Mar 7, 2019

Thank you for your bug report! This sounds like a terrible experience, and I would be happy to review any PR's which address this. Help wanted!

@michtoen
Copy link

OP on company account.

This bug seems to have it root in the --docker-env parser part and when i should guess its related to a broken string processing/pipe by not respecting the double quotes.

A single space in the NO_PROXY rules will break the VM too.
Tests are done with Hyper-V.
I tried 3 different startup lines (without the driver settings)

a.) minikube start --docker-env "NO_PROXY=1.2.3.4,5.6.7.8"
b:) minikube start --docker-env "NO_PROXY=1.2.3.4, 5.6.7.8" # notice the ", " part
c.) minikube start --docker-env NO_PROXY="1.2.3.4, 5.6.7.8" # same

Output of minikube in the terminal:
a:) - env NO_PROXY=1.2.3.4,5.6.7.8
b.) - env NO_PROXY=1.2.3.4, 5.6.7.8
c.) - env NO_PROXY=1.2.3.4, 5.6.7.8

Output with minikube ssh & systemctl show --property=Environment docker

a.) Environment=DOCKER_RAMDISK=yes NO_PROXY=1.2.3.4,5.6.7.8
b.) Environment=DOCKER_RAMDISK=yes NO_PROXY=1.2.3.4,
c.) Environment=DOCKER_RAMDISK=yes NO_PROXY=1.2.3.4,

A buggy string processing of the arguments would also explain the behaviour with the procent encoded string part of the proxy settings - minukube and/or the bash should read the % part then as variable, if i understand this right.

@11janci
Copy link
Contributor

11janci commented Mar 19, 2019

I will take a look at this

@michtoen
Copy link

We start to get the idea this is perhaps not a problem of minikube but of the docker daemon, which can't set the env vars from minikube when they are not in the perfect format.

@11janci
Copy link
Contributor

11janci commented Mar 21, 2019

@MichtToen found the cause of the issue - you were close, except it is not a problem of docker but systemd (the input env vars must be escaped). I will come up with a PR that will do it next week.

@michtoen
Copy link

Great! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking networking issues good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
None yet
Development

No branches or pull requests

4 participants