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

Multipass ignores no_proxy when HTTPS_PROXY is set #3445

Open
Gmerold opened this issue Mar 20, 2024 · 3 comments
Open

Multipass ignores no_proxy when HTTPS_PROXY is set #3445

Gmerold opened this issue Mar 20, 2024 · 3 comments
Labels
Milestone

Comments

@Gmerold
Copy link

Gmerold commented Mar 20, 2024

Describe the bug
Hello Team,

I'm trying to create a Multipass VM in the env running behind the proxy. I'm setting the proxy through /etc/environment (I'm setting both lowercase and uppercase variables for proxy). I don't want Multipass to use the proxy though, because the proxy doesn't allow connections to cdimage.ubuntu.com.
In order to bypass proxy, I've added .ubuntu.com to the no_proxy and NO_PROXY variables.
With this setup, when I try to launch a Multipass instance, I'm getting launch failed: Remote "" is unknown or unreachable. error.
In the daemon status I can see that it's trying to use the proxy anyway:

Mar 19 13:08:58 upf-operator multipassd[2381]: Cannot retrieve headers for https://cdimage.ubuntu.com/ubuntu-core/18/stable/current/ubuntu-core-18-amd64.img.xz: Proxy denied connection
Mar 19 13:08:58 upf-operator multipassd[2381]: Using the 'default' storage pool.
Mar 19 13:08:58 upf-operator multipassd[2381]: Cannot retrieve headers for https://cdimage.ubuntu.com/ubuntu-core/22/stable/current/ubuntu-core-22-amd64.img.xz: Proxy denied connection
Mar 19 13:08:58 upf-operator multipassd[2381]: Cannot retrieve headers for https://cdimage.ubuntu.com/ubuntu-core/16/stable/current/ubuntu-core-16-amd64.img.xz: Proxy denied connection
Mar 19 13:08:58 upf-operator multipassd[2381]: Error getting https://cdimage.ubuntu.com/ubuntu-core/appliances/streams/v1/index.json: Proxy denied connection - trying cache.
Mar 19 13:08:58 upf-operator multipassd[2381]: Could not update manifest: failed to download from 'https://cdimage.ubuntu.com/ubuntu-core/appliances/streams/v1/index.json': Error opening https://cdimage.ubuntu.>
Mar 19 13:08:58 upf-operator multipassd[2381]: Cannot retrieve headers for https://cdimage.ubuntu.com/ubuntu-core/20/stable/current/ubuntu-core-20-amd64.img.xz: Proxy denied connection
Mar 19 13:08:58 upf-operator multipassd[2381]: Could not update manifest: failed to download from 'https://cdimage.ubuntu.com/ubuntu-core/16/stable/current/ubuntu-core-16-amd64.img.xz': Proxy denied connection

Proxy envs passed to the process are:

ubuntu@upf-operator:~$ sudo cat /proc/2554/environ | tr '\0' '\n' | grep -i proxy
HTTPS_PROXY=http://squid.internal:3128
no_proxy=localhost,127.0.0.1,.jujucharms.com,.ubuntu.com,upf-operator
NO_PROXY=localhost,127.0.0.1,.jujucharms.com,.ubuntu.com,upf-operator
https_proxy=
http_proxy=
HTTP_PROXY=http://squid.internal:3128

I tried overwriting the variables using drop-in config, but it didn't help. I tried removing proxy config for the snap using snap set system and snap unset system; also without any luck.

Eventually, I was able to make it run by removing the uppercase env variables from my /etc/environment (HTTP_PROXY, HTTPS_PROXY and NO_PROXY). This doesn't seem right tho.

Would be great if someone could look into it.
Please let me know in case any additional info is needed.

BR,
Bartek

To Reproduce
How, and what happened?

  1. Setup env as described above
  2. multipass launch 22.04

Expected behavior
What did you expect to happen?

Logs
Relevant logs available in the description

Additional info

  • OS: Ubuntu 22.04
  • multipass version = 1.13.1
  • multipass get local.driver = lxd
@Gmerold Gmerold added bug needs triage Issue needs to be triaged labels Mar 20, 2024
@townsend2010
Copy link
Collaborator

townsend2010 commented Mar 20, 2024

Hi @Gmerold!

Thanks for this bug report! I'm curious what your /etc/environment looked like when you have the upper-case http{s} proxies set and what it looks like when this does work. Thanks!

@Gmerold
Copy link
Author

Gmerold commented Mar 21, 2024

Hi @townsend2010!

Sure, here's the original version (not working):

ubuntu@telco-github-runner-1:~$ cat /etc/environment 
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
HTTP_PROXY=http://squid.internal:3128
HTTPS_PROXY=http://squid.internal:3128
NO_PROXY="localhost,127.0.0.1,.jujucharms.com,.ubuntu.com,upf-operator"
http_proxy=http://squid.internal:3128
https_proxy=http://squid.internal:3128
no_proxy="localhost,127.0.0.1,.jujucharms.com,.ubuntu.com,upf-operator"

Then I just removed all 3 uppercase proxy variables.

@townsend2010
Copy link
Collaborator

Hey @Gmerold!

Thanks for posting that. I think I might have found the issue and it shouldn't be too hard to fix.

@townsend2010 townsend2010 removed the needs triage Issue needs to be triaged label Mar 21, 2024
@townsend2010 townsend2010 added this to the 1.14.0 milestone Mar 21, 2024
@townsend2010 townsend2010 self-assigned this Mar 21, 2024
@townsend2010 townsend2010 modified the milestones: 1.14.0, 1.15.0 May 2, 2024
@townsend2010 townsend2010 removed their assignment May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants