maas-import-isos behind a proxy

Asked by Shannon McFarland

The host running MAAS is behind a proxy server in our lab. I can wget anywhere I want as well as do apt-gets (via an export) but when I run the maas-import-isos command I get a whole string of "No route to host" errors as it is trying to go there directly vs. using my proxy.

Is there a way to force MAAS to use a proxy for these imports?

Thanks,
Shannon

Question information

Language:
English Edit question
Status:
Solved
For:
MAAS Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Julian Edwards (julian-edwards) said :
#1

If you set the environment variable http_proxy it should use that.

So something like:
http_proxy=http://my.proxy.com/ maas-import-isos

Or:
export http_proxy=http://my.proxy.com/
maas-import-isos

to set it for everything in your shell.

Revision history for this message
Shannon McFarland (shmcfarl) said :
#2

That is how I have had it set and it never seems to use the proxy. wget and apt-get use it fine.

I get this (just snippet):

-2012-04-26 12:09:09-- http://archive.ubuntu.com/ubuntu/dists/precise-updates/main/installer-amd64/current/images/netboot/mini.iso
Resolving archive.ubuntu.com (archive.ubuntu.com)... 91.189.92.176, 91.189.92.177, 91.189.92.179, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.92.176|:80... failed: No route to host.
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.92.177|:80... failed: No route to host.
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.92.179|:80... failed: No route to host.
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.92.180|:80... failed: No route to host.
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.92.181|:80... failed: No route to host.
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.92.182|:80... ^

It should be hitting the proxy instead of trying to route directly to it.

Revision history for this message
Julian Edwards (julian-edwards) said :
#3

Hmm odd, maas-import-isos just calls cobbler-ubuntu-import which uses wget itself so it ought to use your proxy settings.

Revision history for this message
Julian Edwards (julian-edwards) said :
#4

Did you export http_proxy in your shell? Wthout the export the variable won't reach anything that mass-import-isos calls out to.

Revision history for this message
Shannon McFarland (shmcfarl) said :
#5

Yes, I did an export in my shell. I am going to temporarily move the MAAS host outside of my proxy to get this finished up. Thanks for your help.

Revision history for this message
Julian Edwards (julian-edwards) said :
#6

Ok I am sorry I could not be of more help. As far as I know, this really ought to work so I am going to file a bug.

Revision history for this message
Julian Edwards (julian-edwards) said :
#7

I think sudo is not helping us. You could try it like this:

sudo su -
export http_proxy= ....
maas-import-isos

Revision history for this message
drolfe (drolfe) said :
#8

If you can see your http_proxy when running the command env, then make sure you run sudo with the -E option to (preserve environment)

i.e.

sudo -E maas-import-isos

Revision history for this message
Jacek (jacek-r-e) said :
#9

You need to set both:
http_proxy
and:
https_proxy

Worked fine for me; failed when I had only first set.

Revision history for this message
Julian Edwards (julian-edwards) said :
#10

Marking solved.