yum error behind proxy

General support questions including new installations

yum error behind proxy

Postby rlmcclain » 2005/06/03 19:19:50

Just installed Centos 4.0 from CDs. I am behind a proxy server which requires authentication. I can successfully browse the web with Firefox after configuring for the proxy in Firefox and responding to the authentication prompts. I can successfully run wget through the proxy (even downloading the xml file that yum failes on - see below). So far my only failure is with yum.

Reading the yum documentation and other forum and google comments, I see references to proxy setting in yum.conf and to the environment variable http_proxy. I've tried both with no success.

With the proxy defined in yum.conf and no http_proxy set, I get the following:

[root@dbatux etc]# yum update
Setting up Update Process
Setting up Repos
http://mirror.centos.org/centos/4/addon ... repomd.xml: [Errno 4] IOError:
Trying other mirror.
Cannot open/read repomd.xml file for repository: addons
failure: repodata/repomd.xml from addons: [Errno 256] No more mirrors to try.

With http_proxy set, I get the following:

[root@dbatux etc]# yum update
Setting up Update Process
Setting up Repos
addons 100% |=========================| 951 B 00:00
Traceback (most recent call last):
File "/usr/bin/yum", line 7, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 68, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py", line 408, in doCommands
return self.updatePkgs()
File "/usr/share/yum-cli/cli.py", line 923, in updatePkgs
self.doRepoSetup()
File "/usr/share/yum-cli/cli.py", line 76, in doRepoSetup
repo.getRepoXML(text=repo)
File "repos.py", line 550, in getRepoXML
File "repos.py", line 527, in get
File "mirror.py", line 414, in urlgrab
File "mirror.py", line 400, in _mirror_try
File "grabber.py", line 605, in urlgrab
File "grabber.py", line 534, in _retry
File "grabber.py", line 591, in retryfunc
File "grabber.py", line 714, in __init__
File "grabber.py", line 758, in _do_open
File "grabber.py", line 835, in _make_request
File "/usr/lib/python2.3/urllib2.py", line 326, in open
'_open', req)
File "/usr/lib/python2.3/urllib2.py", line 306, in _call_chain
result = func(*args)
File "/usr/lib/python2.3/urllib2.py", line 491, in
lambda r, proxy=url, type=type, meth=self.proxy_open: \
File "/usr/lib/python2.3/urllib2.py", line 498, in proxy_open
if '@' in host:
TypeError: iterable argument required

wget, however, works filne.

[root@dbatux etc]# wget http://mirror.centos.org/centos/4/addon ... repomd.xml
--15:04:43-- http://mirror.centos.org/centos/4/addon ... repomd.xml
=> `repomd.xml'
Connecting to 10.87.45.100:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 951 [text/xml]

100%[=======================================================>] 951 --.--K/s

15:04:44 (9.07 MB/s) - `repomd.xml' saved [951/951]

My http_proxy is set to this format "http://username:password@proxyip:port"

Thanks for help in advance.
rlmcclain
 
Posts: 2
Joined: 2005/06/03 17:01:10

yum error behind proxy

Postby hughesjr » 2005/06/04 19:33:46

man yum says:

Code: Select all
       proxy  url to the proxy server that yum should use.

       proxy_username
              username to use for proxy

       proxy_password
              password for this proxy


So in /etc/yum.conf try this:

Code: Select all
proxy="http://proxyip:port"
proxy_username="username"
proxy_password="password"
hughesjr
Site Admin
 
Posts: 229
Joined: 2004/12/05 01:51:26
Location: Corpus Christi, Texas, USA

Re: yum error behind proxy

Postby rlmcclain » 2005/06/06 16:36:46

Thanks, but as I said in my original post, I tried setting these three variables in yum.conf with the result below. I also tried increasing the errorllevel and debuglevel parameters, but yum produced no additional errors or logs.

[root@dbatux etc]# yum -d 10 update
Yum Version: 2.2.0
COMMAND: yum -d 10 update
Installroot: /
Setting up Update Process
Setting up Repos
Baseurl(s) for repo: ['http://mirror.centos.org/centos/4/addons/i386/']
http://mirror.centos.org/centos/4/addon ... repomd.xml: [Errno 4] IOError:
Trying other mirror.
Cannot open/read repomd.xml file for repository: addons
failure: repodata/repomd.xml from addons: [Errno 256] No more mirrors to try.
rlmcclain
 
Posts: 2
Joined: 2005/06/03 17:01:10

Re: yum error behind proxy

Postby kreyz28 » 2005/06/17 13:31:56

I too had no success using the proxy options in yum.conf, instead I set the HTTP_PROXY variable in /etc/profile to make it work.

/etc/profile

......
HTTP_PROXY="http://yourproxy.yourdomain.com:80"
export HTTP_PROXY
.......

don't forget to source it to make it available
kreyz28
 
Posts: 1
Joined: 2005/06/17 13:26:30

Re: yum error behind proxy

Postby jimbojones » 2005/09/12 19:36:33

What do you mean by "don't forget to source it to make it available"?


Thanks
jimbojones
 
Posts: 2
Joined: 2005/09/12 19:33:07

Re: yum error behind proxy

Postby K_Frye » 2005/09/12 20:16:08

jimbojones wrote:
What do you mean by "don't forget to source it to make it available"?


Thanks


The file needs to be "reloaded" for the changes to take effect.
K_Frye
 
Posts: 427
Joined: 2005/07/13 01:48:35
Location: Canada

Re: yum error behind proxy

Postby blaz » 2005/09/22 13:13:38

Hello

I'm use proxy allso, by hand with export ... :-(
Today I find question and answer by hughesjr.

Like bingo. I try, but without succes to reach mirror. So I look in man and there find solution which hughesjr talk about.

So in /etc/yum.conf I change
proxy="http://proxyip:port"
proxy_username="username"
proxy_password="password"

to
proxy=http://proxy.mydomain.si:80/
proxy_username=
proxy_password=

I set proxy without username and password and write 3 lines without quotation.
And yum update start to work without exporting http... :-)
blaz
 
Posts: 3
Joined: 2005/09/22 12:31:00
Location: Slovenija

Re: yum error behind proxy

Postby Evolution » 2005/09/22 13:28:05

Does the proxy apply to ftp also? many times the yum+proxy issue can be fixed by simply using a mirror with ftp access instead of http access.
Evolution
 
Posts: 229
Joined: 2005/02/22 16:10:54
Location: Houston Texas

Re: yum error behind proxy

Postby blaz » 2005/09/22 13:43:24

:-) yes, now I can also get ftp.
blaz
 
Posts: 3
Joined: 2005/09/22 12:31:00
Location: Slovenija

Re: yum error behind proxy

Postby carknc » 2006/02/08 17:19:35

Hi --

I'm still having this issue myself. Putting HTTP_PROXY into my /etc/profile helped, now I get a 407 instead. Are there other variables I can set to get the username and password in there? Having them in my yum.conf didn't help at all.

Thanks.

EDIT: the fix is -- http_proxy=http://user:passwd@proxy.foo.com:portnumber
carknc
 
Posts: 3
Joined: 2006/02/08 17:17:26

Next

Return to CentOS 4 - General Support

Who is online

Users browsing this forum: No registered users and 1 guest