Bug 850 - pkgsend traceback if invalid or unavailable repository url specified
: pkgsend traceback if invalid or unavailable repository url specified
Status: RESOLVED FIXINSOURCE
Product: pkg
pkgsend
: unspecified
: ANY/Generic OpenSolaris
: P4 minor (vote)
: ---
Assigned To: Shawn Walker
: pkg/pkgsend watcher
:
: needstestcase
:
:
:
  Show dependency treegraph
 
Reported: 2008-03-24 17:38 UTC by erik.lafever
Modified: 2009-02-13 12:07 UTC (History)
3 users (show)

See Also:


Attachments


Note

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


Description erik.lafever 2008-03-24 17:38:41 UTC
pkgsend gives large traceback if pkg.depotd is not running or if the wrong url
is provided with the -s option.

below are tracebacks from the following:

pkgsend open test@1   (when no pkg.depotd server running)
pkgsend -s http://localhost:88 open test@1 (while pkg.depotd running on port
80)


There are also tracebacks when malformed url's are used

pkgsend -s tar open test@1




Commands and tracebacks:

# pkgsend open test@1
Traceback (most recent call last):
  File "/usr/bin/pkgsend", line 345, in ?
    ret = main_func()
  File "/usr/bin/pkgsend", line 314, in main_func
    trans_open(pcfg, pargs)
  File "/usr/bin/pkgsend", line 105, in trans_open
    status, id = t.open(config, pargs[0])
  File "/usr/lib/python2.4/vendor-packages/pkg/publish/transaction.py", line
57, in open
    headers = {"Client-Release": os.uname()[2]})
  File "/usr/lib/python2.4/vendor-packages/pkg/misc.py", line 77, 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 1021, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.4/urllib2.py", line 996, in do_open
    raise URLError(err)
URLError: <urlopen error (146, 'Connection refused')>


ewbox# pkgsend -s http://localhost:80 open test@1
export PKG_TRANS_ID=1206405459_pkg%3A%2Ftest%401%2C5.11%3A20080324T173739Z
ewbox# pkgsend -s http://localhost:88 open test@1
Traceback (most recent call last):
  File "/usr/bin/pkgsend", line 345, in ?
    ret = main_func()
  File "/usr/bin/pkgsend", line 314, in main_func
    trans_open(pcfg, pargs)
  File "/usr/bin/pkgsend", line 105, in trans_open
    status, id = t.open(config, pargs[0])
  File "/usr/lib/python2.4/vendor-packages/pkg/publish/transaction.py", line
57, in open
    headers = {"Client-Release": os.uname()[2]})
  File "/usr/lib/python2.4/vendor-packages/pkg/misc.py", line 77, 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 1021, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.4/urllib2.py", line 996, in do_open
    raise URLError(err)
URLError: <urlopen error (146, 'Connection refused')>

 pkgsend -s tar open test@1
Traceback (most recent call last):
  File "/usr/bin/pkgsend", line 345, in ?
    ret = main_func()
  File "/usr/bin/pkgsend", line 314, in main_func
    trans_open(pcfg, pargs)
  File "/usr/bin/pkgsend", line 105, in trans_open
    status, id = t.open(config, pargs[0])
  File "/usr/lib/python2.4/vendor-packages/pkg/publish/transaction.py", line
57, in open
    headers = {"Client-Release": os.uname()[2]})
  File "/usr/lib/python2.4/vendor-packages/pkg/misc.py", line 55, in
versioned_urlopen
    raise ValueError, "Malformed URL: %s" % base_uri
ValueError: Malformed URL: tar
Comment 1 Dan Price 2008-08-28 17:25:52 UTC
Bulk move of pkgsend bugs to new category.
Comment 2 Brad Hall 2008-09-16 22:24:55 UTC
Taking this one, accepting
Comment 3 Brad Hall 2008-09-16 22:28:45 UTC
We need to catch the exceptions and print something reasonable, moving to fix
in progress
Comment 4 Dan Price 2008-09-18 01:47:14 UTC
Assigning to Brad, as I assume he meant to pick this up.
Comment 5 Danek Duvall 2009-01-06 09:43:50 UTC
Resetting assignee (and maybe changing status back to accepted) since Brad's
leaving Sun and likely won't be able to work on this bug.
Comment 6 Shawn Walker 2009-02-03 18:37:32 UTC
Repository URLs should be validated and repository communication errors caught.
Comment 7 Shawn Walker 2009-02-13 12:07:40 UTC
Fixed in changeset 873 / b95d76c53b5eeece7335982e3ccf7047770decc4.