Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 161190 - proxy setting in yum.conf is ignored
Summary: proxy setting in yum.conf is ignored
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 4
Hardware: noarch
OS: Linux
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
: 178805 186555 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2005-06-21 08:25 UTC by Tomasz Kepczynski
Modified: 2014-01-21 22:52 UTC (History)
11 users (show)

Fixed In Version: 2.4.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-04-10 18:46:36 UTC

Attachments (Terms of Use)
strace -ff -o yum.log yum update (deleted)
2005-09-23 06:27 UTC, Tomasz Kepczynski
no flags Details

Description Tomasz Kepczynski 2005-06-21 08:25:29 UTC
Description of problem:
According to yum.conf man page proxy setting in yum.conf contains url to
proxy server yum should use. I've put the following line in my yum.conf:
as the last uncommented line in main section.
Regardless of the above setting yum tries to connect directly.
Setting http_proxy in environment works as expected.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. set proxy in yum.conf as described above
2. try to issue yum update
Actual results:
yum tries to connect directly (and can't due to firewall)

Expected results:
yum goes through proxy as described in man page

Additional info:

Comment 1 Frode Tennebø 2005-09-06 07:57:44 UTC
I'm had the same problem as you. Setting the environment as follows:

export HTTP_PROXY="" (in your case)

solved my problem. I also commented out the yum.conf proxy entry.

Comment 2 Jeremy Katz 2005-09-21 19:27:47 UTC
Does this still occur with yum 2.4.0?

Comment 3 Graham King 2005-09-22 09:11:24 UTC
I just tested with yum-2.4.0-0.fc4 and the proxy setting in yum.conf was honoured.

Comment 4 Tomasz Kepczynski 2005-09-22 09:23:15 UTC
yum     19236 root    4u  IPv4 12089754              TCP> (SYN_SENT)

and /etc/yum.conf:


# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

So for me yum-2.4.0-0.fc4 does not work as expected.

Comment 5 Tomasz Kepczynski 2005-09-22 19:30:33 UTC
I thought I was clear that it does NOT work for me. Config above has
proxy set inside a file and yum attempts to connect directly to (as a line from lsof listing shows) which of
course is stuck in SYN_SENT as there is no response coming back
due to firewall.

Comment 6 Dan Hollis 2005-09-22 22:25:27 UTC
x86_64 yum-2.4.0-0.fc4 seems to proxy ok for me.

of course no solution for fc3 ...

Comment 7 Tomasz Kepczynski 2005-09-23 06:27:44 UTC
Created attachment 119176 [details]
strace -ff -o yum.log yum update

Comment 8 Tomasz Kepczynski 2005-09-23 06:31:58 UTC
I don't understand why but on two machines yum behaves differently.
Attachment above is from i686 SMP where yum does not honour proxy
setting from configuration file (comment #4). On anotcher machine
(x86_64) everything seems to work fine...
Is it possible that yum tries to read something from up2date which
may affect its behaviour?

Comment 9 Frode Tennebø 2005-09-28 12:04:23 UTC
[ft@garvin ~]$ cat /etc/yum.conf

[ft@garvin ~]$ rpm -q yum

[root@garvin ~]# yum upgrade
Setting up Upgrade Process
Setting up repositories
Cannot find a valid baseurl for repo: updates-released
Error: Cannot find a valid baseurl for repo: updates-released

[root@garvin ~]# export HTTP_PROXY=http://www-proxy:81/
[root@garvin ~]# yum upgrade
Setting up Upgrade Process
Setting up repositories
updates-released          100% |=========================|  951 B    00:00     
extras                    100% |=========================| 1.1 kB    00:00     
base                      100% |=========================| 1.1 kB    00:00     

So for me, 2.4.0 also does NOT work.

Comment 10 Tomasz Kepczynski 2005-09-28 12:08:42 UTC
For the comment #8 - the x86_64 which seemed to work actually worked
only because it was behind transparent proxy. yum insists on contacting, probably to get mirror list.

Comment 11 Frode Tennebø 2005-09-28 12:14:42 UTC
s/work/honour proxy settings in yum.conf/

Comment 12 Stephan Ebelt 2005-12-22 12:02:19 UTC
I ran into exactly this issue on a fresh FC4 installation. The last update
installed yum-2.4.1-1.fc4.

It just ignores the proxy setting in yum.conf and attempts to make a direct

# grep proxy /etc/yum.conf

# yum update &

# netstat 
Proto Recv-Q Send-Q Local Address       Foreign Address         State
tcp        0      1 dd-lx-gsx03:53794     SYN_SENT

Setting $http_proxy works. But *only if* there is a slash at the end. E.g.

export http_proxy=http://proxy.some.tld:3128/

rather than

export http_proxy=http://proxy.some.tld:3128

Comment 13 Andrea Pasquinucci 2006-01-08 14:51:06 UTC
There is something wrong in the parsing of the ENV variables HTTP_PROXY and
http_proxy, I tried various forms for them  like 

export http_proxy=http://proxy.some.tld:3128
export http_proxy=http://proxy.some.tld:3128/
export http_proxy=proxy.some.tld:3128
export http_proxy=proxy.some.tld:3128/

getting every time different results, either working or something like

 Setting up repositories
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
  File "/usr/share/yum-cli/", line 92, in main
    result, resultmsgs = do()
  File "/usr/share/yum-cli/", line 528, in doCommands
    ypl = self.returnPkgLists()
  File "/usr/share/yum-cli/", line 1170, in returnPkgLists
    ypl = self.doPackageLists(pkgnarrow=pkgnarrow)
  File "", line 904, in doPackageLists
  File "/usr/share/yum-cli/", line 71, in doRepoSetup
    yum.YumBase.doRepoSetup(self, thisrepo=thisrepo)
  File "", line 233, in doRepoSetup
  File "", line 681, in getRepoXML
  File "", line 624, in get
  File "/usr/lib/python2.4/site-packages/urlgrabber/", line 414, in urlgrab
    return self._mirror_try(func, url, kw)
  File "/usr/lib/python2.4/site-packages/urlgrabber/", line 400, in
    return func_ref( *(fullurl,), **kwargs )
  File "/usr/lib/python2.4/site-packages/urlgrabber/", line 618, in
    return self._retry(opts, retryfunc, url, filename)
  File "/usr/lib/python2.4/site-packages/urlgrabber/", line 547, in _retry
    return apply(func, (opts,) + args, {})
  File "/usr/lib/python2.4/site-packages/urlgrabber/", line 604, in
    fo = URLGrabberFileObject(url, filename, opts)
  File "/usr/lib/python2.4/site-packages/urlgrabber/", line 727, in
  File "/usr/lib/python2.4/site-packages/urlgrabber/", line 794, in
    fo, hdr = self._make_request(req, opener)
  File "/usr/lib/python2.4/site-packages/urlgrabber/", line 881, in
    fo =
  File "/usr/lib/python2.4/", line 358, in open
    response = self._open(req, data)
  File "/usr/lib/python2.4/", line 376, in _open
    '_open', req)
  File "/usr/lib/python2.4/", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.4/", line 573, in <lambda>
    lambda r, proxy=url, type=type, meth=self.proxy_open: \
  File "/usr/lib/python2.4/", line 580, in proxy_open
    if '@' in host:
TypeError: iterable argument required

Comment 14 Hugo Cisneiros 2006-01-24 15:26:26 UTC
*** Bug 178805 has been marked as a duplicate of this bug. ***

Comment 15 John Saalwaechter 2006-03-23 23:10:39 UTC
This is still a problem under Fedora Core 5. I just did a fresh
install of FC5. I put a proxy line in the [main] section of
/etc/yum.conf, and I got the error:

Error: Cannot find a valid baseurl for repo: core

I looked at the python involved, and the problem that I see is that
the getMirrorList() function in /usr/lib/python2.4/site-packages/yum/
does not provide any of the URLGrabber configuration that the
Repository.setupGrab() method does for the Repository object. In
getMirrorList() it's just doing a bare url grab. The first url grabbed is
the mirrorlist, which fails (silently) and eventually leads to the
"Cannot find a valid baseurl for repo: core" error.

To show that this is the problem, I did a quick hack of so that
the Repository object's self.proxy_dict is sent to the getMirrorList()
function for its use.  That solved my problem (i.e. I can set proxy in
/etc/yum.conf and it works).

Here's a diff showing the hack:

# cat /etc/fedora-release
Fedora Core release 5 (Bordeaux)
# rpm -q yum
# grep proxy /etc/yum.conf
# cd /usr/lib/python2.4/site-packages/yum
# diff
<             mirrorurls = getMirrorList(self.mirrorlist)
>             mirrorurls = getMirrorList(self.mirrorlist,self.proxy_dict)
< def getMirrorList(mirrorlist):
> def getMirrorList(mirrorlist,pdict):
<         fo = urlresolver.urlopen(url)
>         fo = urlresolver.urlopen(url,proxies=pdict)

Comment 16 Jeremy Katz 2006-03-24 15:47:27 UTC
*** Bug 186555 has been marked as a duplicate of this bug. ***

Comment 17 Jeremy Katz 2006-04-10 18:46:36 UTC
Committed to CVS and will build for the devel tree for tomorrow.  If you could
get that package and test it with FC5 that would help (and then I'll eventually
push for an fc5 update)

Note You need to log in before you can comment on or make changes to this bug.