Issue570

Title Stacktrace when pushing across HTTP "Basic" Auth and using wrong username/password
Priority bug Status resolved
Superseder Nosy List alexis, criswell
Assigned To alexis Topics

Created on 2007-05-24.17:03:07 by criswell, last changed 2007-06-23.00:29:48 by alexis.

Messages
msg3278 (view) Author: alexis Date: 2007-06-23.00:29:48
This should be fixed by http://www.selenic.com/hg/rev/a814a5b11fff
msg3129 (view) Author: alexis Date: 2007-05-25.17:36:09
This is actually a python bug, which is fixed in 2.5 (the digest auth stuff
shouldn't raise an exception in this case).

I'll try to come up with a workaround.
msg3124 (view) Author: criswell Date: 2007-05-24.17:03:02
When you have a remote repo using hgweb.cgi or hgwebdir.cgi over HTTP using
Apache with "AuthType Basic" set, if you try to push with an incorrect
username/password combination you get the following stacktrace from hg:

$ hg push
pushing to http://someurl/somerepo/
searching for changes
http authorization required
realm: Dev Repo
user: sam
password: 
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 0.9.3)
Traceback (most recent call last):
  File "/usr/bin/hg", line 12, in ?
    commands.run()
  File "/var/lib/python-support/python2.4/mercurial/commands.py", line 3000, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/var/lib/python-support/python2.4/mercurial/commands.py", line 3223, in
dispatch
    return d()
  File "/var/lib/python-support/python2.4/mercurial/commands.py", line 3182, in
<lambda>
    d = lambda: func(u, repo, *args, **cmdoptions)
  File "/var/lib/python-support/python2.4/mercurial/commands.py", line 1971, in push
    r = repo.push(other, opts['force'], revs=revs)
  File "/var/lib/python-support/python2.4/hgext/mq.py", line 2025, in push
    return super(mqrepo, self).push(remote, force, revs)
  File "/var/lib/python-support/python2.4/mercurial/localrepo.py", line 1360, in
push
    return self.push_unbundle(remote, force, revs)
  File "/var/lib/python-support/python2.4/mercurial/localrepo.py", line 1438, in
push_unbundle
    return remote.unbundle(cg, remote_heads, 'push')
  File "/var/lib/python-support/python2.4/mercurial/httprepo.py", line 352, in
unbundle
    heads=' '.join(map(hex, heads)))
  File "/var/lib/python-support/python2.4/mercurial/httprepo.py", line 235, in
do_cmd
    resp = urllib2.urlopen(urllib2.Request(cu, data, headers))
  File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.4/urllib2.py", line 364, in open
    response = meth(req, response)
  File "/usr/lib/python2.4/urllib2.py", line 471, in http_response
    response = self.parent.error(
  File "/usr/lib/python2.4/urllib2.py", line 396, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.4/urllib2.py", line 741, in http_error_401
    host, req, headers)
  File "/usr/lib/python2.4/urllib2.py", line 720, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib/python2.4/urllib2.py", line 730, in retry_http_basic_auth
    return self.parent.open(req)
  File "/usr/lib/python2.4/urllib2.py", line 364, in open
    response = meth(req, response)
  File "/usr/lib/python2.4/urllib2.py", line 471, in http_response
    response = self.parent.error(
  File "/usr/lib/python2.4/urllib2.py", line 396, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.4/urllib2.py", line 916, in http_error_401
    host, req, headers)
  File "/usr/lib/python2.4/urllib2.py", line 807, in http_error_auth_reqed
    raise ValueError("AbstractDigestAuthHandler doesn't know "
ValueError: AbstractDigestAuthHandler doesn't know about Basic
History
Date User Action Args
2007-06-23 00:29:48alexissetstatus: chatting -> resolved
messages: + msg3278
2007-05-25 17:36:09alexissetstatus: unread -> chatting
nosy: + alexis
messages: + msg3129
assignedto: alexis
2007-05-24 17:03:07criswellcreate