dput HTTP(S) auth fails with stack trace on 2.6.4-0ubuntu1 (karmic) and 0.9.5.1ubuntu1 (lucid)

Bug #531758 reported by pdf
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dput (Debian)
Fix Released
Unknown
dput (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: dput

Uploading via HTTP(S) is currently broken when auth is enabled, and bails with the following stack trace:

Uploading to hostname (via https to host.domain.tld):
  Uploading packagename.dsc: need authentication.
    Password for Host Package Upload:
Traceback (most recent call last):
  File "/usr/bin/dput", line 944, in <module>
    main()
  File "/usr/bin/dput", line 907, in main
    files_to_upload, debug, 0, progress=progress)
  File "/usr/share/dput/https.py", line 7, in upload
    return real_upload(fqdn, login, incoming, files_to_upload, debug, dummy, progress, protocol="https")
  File "/usr/share/dput/http.py", line 117, in upload
    auth_headers = AuthHandlerHackAround(url, res.msg, pwman).get_auth_headers()
  File "/usr/share/dput/http.py", line 51, in get_auth_headers
    ah.http_error_401(self, None, 401, None, self.resp_headers)
  File "/usr/lib/python2.6/urllib2.py", line 853, in http_error_401
    url, req, headers)
  File "/usr/lib/python2.6/urllib2.py", line 831, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib/python2.6/urllib2.py", line 841, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)

ProblemType: Bug
Architecture: amd64
Date: Thu Mar 4 17:46:33 2010
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: dput 0.9.4ubuntu2
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_AU.UTF-8
ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
SourcePackage: dput
Uname: Linux 2.6.31-19-generic x86_64

Revision history for this message
pdf (pdffs) wrote :
Revision history for this message
pdf (pdffs) wrote :

Attached patch resolves the problem by adding timeout, and allowing keyword arguments to AuthHandlerHackAround.open(), should be backwards-compatible also.

tags: added: patch
pdf (pdffs)
summary: - dput HTTP(S) auth fails with stack trace on 2.6.4-0ubuntu1
+ dput HTTP(S) auth fails with stack trace on 2.6.4-0ubuntu1 (karmic) and
+ 0.9.5.1ubuntu1 (lucid)
Revision history for this message
pdf (pdffs) wrote :

Problem still occurs on lucid, with additional change required due to further modifications in the version of urllib2.py shipping with lucid. Attached patch resolves for lucid.

tags: added: patch-forwarded-debian
Changed in dput (Debian):
status: Unknown → New
Revision history for this message
pdf (pdffs) wrote :

Thanks for forwarding to Debian, but this won't affect Debian until they move to greater than python-2.5. The whole surrounding chunk of code is really quite ugly, and extremely brittle - it's likely to break again whenever urllib2 changes in various ways in the future. Testing can be achieved simply by pointing at any HTTPS enabled WebDAV server - doesn't have to actually have a queue behind it. I'll try and post this information to the upstream bug if I can work out how to use their bug tracker without subscribing to the list...

Changed in dput (Debian):
status: New → Fix Committed
Revision history for this message
pdf (pdffs) wrote :

I don't see this fix being committed upstream, and as this is only affecting Ubuntu's Python version, and is still (!) broken in current releases, I'd really appreciate having this patched in Ubuntu so we don't have to keep maintaining a local copy. Appears this is still unpatched in all subsequent versions of dput in Ubuntu releases.

Revision history for this message
pdf (pdffs) wrote :

Have verified patch still resolves the issue on Precise (dput-0.9.6.2ubuntu1), can perform further verification on subsequent releases if this has any hope of being merged.

Revision history for this message
pdf (pdffs) wrote :

Still in Raring/Saucy.

Revision history for this message
pdf (pdffs) wrote :

w00t, upstream actually merged this.

Changed in dput (Debian):
status: Fix Committed → Fix Released
Changed in dput (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.