up2date and proxy?
Joe Ammond
joe.ammond at edwardjones.com
Thu Oct 16 21:09:04 UTC 2003
On Thu, 2003-10-16 at 08:32, nsilva-list at aoi.atari-source.com wrote:
> I am trying to use up2date on fc1t3 and a proxy server, and while up2date
> has a place to fill in the proxy info, it seems like it isn't working? (or
> redhat's site is timing out?)
>
> Actually, the problem doesn't seem to be the proxy server or redhat's
> site, because I can load the URL fine in mozilla.
>
> Just for kicks, I set the http_proxy env. var., no change.
>
> also for fun, I tried passing the proxy info on the command like with
> --proxy, --proxyUser, and --proxy-Password, but then it gave me even
> stranger errors ("Invalid option -r").
>
> partial error:
> return opener.open(request)
> File "/usr/lib/python2.2/urllib2.py", line 328, in open
> '_open', req)
> File "/usr/lib/python2.2/urllib2.py", line 307, in _call_chain
> result = func(*args)
> File "/usr/lib/python2.2/urllib2.py", line 824, in http_open
> return self.do_open(httplib.HTTP, req)
> File "/usr/lib/python2.2/urllib2.py", line 809, in do_open
> raise URLError(err)
> urllib2.URLError: <urlopen error (110, 'Connection timed out')>
I've done some digging into this issue. I normally don't log in
directly as root, but sudo or su to run up2date.
The yumRepo backend (which up2date uses to comminicate with a yum
repository) uses the python urllib and urllib2 modules. Both of
them respect the *_proxy environment variables. The yumRepo backend
doesn't grab the proxy preferences from the up2date configuration, tho.
I found that no matter how I set it, the http_proxy environment
var wasn't getting to up2date. A print of os.environ showed a pristine
environment. After much poking around in the up2date_client python
code, I had a *duh* moment.
consolehelper
A quick path check showed that I was running /usr/bin/up2date, linked
to consolehelper, which cleans the environment and calls
/usr/sbin/up2date. Running /usr/sbin/up2date with http_proxy set
allowed the yumRepo backend the ability to communicate through the
proxies here without any problems.
The real solution would be to re-write the yumRepo backend to honor
the up2date configuration and call urllib/urllib2 with the appropriate
proxies, but this works for now. I started patching yumRepo, but I'm
not a python hacker, and didn't want to duplicate effort if this is
already being worked on.
I hope this helps others who have been stuck with this.
ja.
--
Joe Ammond joe.ammond at edwardjones.com
More information about the fedora-test-list
mailing list