Bugzilla – Bug 305
http_proxy value needs more checking for valid url syntax
Last modified: 2009-07-01 16:40:08 UTC
You need to log in before you can comment on or make changes to this bug.
provide more checking for valid url syntax in http_proxy, and more comprehensible output. (build used: OpenSolaris Developer Preview snv_75a X86) Example: miss-spelled http protocol $ http_proxy=htpp://<fully qualified domain web cache>:8080 $ export http_proxy $ pkg image-create -U -a sun.com://updates.sfbay.sun.com:10000 TEST_GF_V2 => output pkg:n Example: ftp used instead of http in the URL, will get Traceback of calls ftpwrapper(user, passwd, host, port, dirs) and in the end IOError: [Errno ftp error]
added myself in cc
*** Bug 1214 has been marked as a duplicate of this bug. ***
Bug 1214 specifically had a stack trace because the proxy was specified without the leading "http://", and the stack was quite specific: Traceback (most recent call last): File "/usr/bin/pkg", line 1440, in ? ret = main_func() File "/usr/bin/pkg", line 1406, in main_func return install(img, pargs) File "/usr/bin/pkg", line 469, in install img.imageplan.execute() File ".../pkg/client/imageplan.py", line 394, in execute p.preexecute() File ".../pkg/client/pkgplan.py", line 242, in preexecute flist.get_files() File ".../pkg/client/filelist.py", line 139, in get_files imgtype = self.image.type) File ".../pkg/misc.py", line 107, in versioned_urlopen c = url_opener(req) File "/usr/lib/python2.4/urllib2.py", line 358, in open response = self._open(req, data) File "/usr/lib/python2.4/urllib2.py", line 376, in _open '_open', req) File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain result = func(*args) File "/usr/lib/python2.4/urllib2.py", line 573, in <lambda> lambda r, proxy=url, type=type, meth=self.proxy_open: \ File "/usr/lib/python2.4/urllib2.py", line 580, in proxy_open if '@' in host: TypeError: iterable argument required
(In reply to comment #3) > Bug 1214 specifically had a stack trace because the proxy was specified without > the leading "http://", and the stack was quite specific: > > Traceback (most recent call last): > File "/usr/bin/pkg", line 1440, in ? > ret = main_func() > File "/usr/bin/pkg", line 1406, in main_func > return install(img, pargs) > File "/usr/bin/pkg", line 469, in install > img.imageplan.execute() > File ".../pkg/client/imageplan.py", line 394, in execute > p.preexecute() > File ".../pkg/client/pkgplan.py", line 242, in preexecute > flist.get_files() > File ".../pkg/client/filelist.py", line 139, in get_files > imgtype = self.image.type) > File ".../pkg/misc.py", line 107, in versioned_urlopen > c = url_opener(req) > File "/usr/lib/python2.4/urllib2.py", line 358, in open > response = self._open(req, data) > File "/usr/lib/python2.4/urllib2.py", line 376, in _open > '_open', req) > File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain > result = func(*args) > File "/usr/lib/python2.4/urllib2.py", line 573, in <lambda> > lambda r, proxy=url, type=type, meth=self.proxy_open: \ > File "/usr/lib/python2.4/urllib2.py", line 580, in proxy_open > if '@' in host: > TypeError: iterable argument required I just wanted to confirm that I got the same thing. I forgot the "http://" and I got the same stack trace as Danek Duvall above.
An update on the output. The pkg command is now catching the exception, so the output is more succinct. However, the error message still doesn't give the user much information about the value for the proxy being invalid. Here's the new output: export http_proxy=http/uc:uc@webcache.france.sun.com:8080 $ ./bin/pkg refresh pkg: 0/1 catalogs successfully updated: Could not retrieve catalog from 'dev.sun.com' Exception: str:iterable argument required repr:<exceptions.TypeError instance at 0x6a66e8>
*** Bug 6384 has been marked as a duplicate of this bug. ***
*** Bug 7333 has been marked as a duplicate of this bug. ***
This bug is being fixed as part of the transport re-design. A preliminary webrev is available from: http://cr.opensolaris.org/~johansen/webrev-xport-1/
Integrated 1Jul2009 as change set a48bee2a4b2e9c8345c29acea63116acf77dddb3