crash on https with forced auth

phobie avatarphobie created an issue

hg crashed as I tried to clone a svn-repo on a apache with forced read authentication.

I use Debian/sid and the server uses Debian/squeeze

  • subversion 1.6.12dfsg-2
  • mercurial 1.6.4-1
  • python2.6 2.6.6-6
  • python-subvertpy 0.7.3-1

Accessing https://myname@svn.myserver.org/mysvn with a web-browser works fine after supplying a password.

Works fine

$ LANG=C hg clone svn+ssh://myserver/path/to/mysvn myhg

Needs hgsubversion on the other side?

$ LANG=C hg clone ssh://myserver/path/to/mysvn myhg
myname@myserver's password: 
remote: abort: There is no Mercurial repository here (.hg not found)!
abort: no suitable response from remote hg!

Continuously asks for my password

$ LANG=C hg clone https://myname@svn.myserver.org/mysvn myhg
http authorization required
realm: Subversion repository for mysvn
user: myname
password: 
http authorization required
realm: Subversion repository for mysvn
user: myname
password: 
http authorization required
realm: Subversion repository for mysvn
user: myname
password:
[...]

Crashes

$ LANG=C hg clone svn+https://myname@svn.myserver.org/mysvn myhg
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Python 2.6.6 (r266:84292, Oct  9 2010, 12:24:52) [GCC 4.4.5]
** Mercurial Distributed SCM (version 1.6.4)
** Extensions loaded: hgsubversion
Traceback (most recent call last):
  File "/usr/bin/hg", line 27, in <module>
    mercurial.dispatch.run()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 34, in dispatch
    return _runcatch(u, args)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 54, in _runcatch
    return _dispatch(ui, args)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 494, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 355, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 545, in _runcommand
    return checkargs()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 499, in checkargs
    return cmdfunc()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 492, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 420, in check
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/extensions.py", line 129, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 420, in check
    return func(*args, **kwargs)
  File "/media/links/dev/hgsubversion/hgsubversion/wrappers.py", line 451, in clone
    orig(ui, source, dest, **opts)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 420, in check
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/commands.py", line 725, in clone
    branch=opts.get('branch'))
  File "/usr/lib/pymodules/python2.6/mercurial/extensions.py", line 174, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/media/links/dev/hgsubversion/hgsubversion/wrappers.py", line 442, in hgclonewrapper
    data['srcrepo'], data['dstrepo'] = orig(ui, origsource, dest, **opts)
  File "/usr/lib/pymodules/python2.6/mercurial/hg.py", line 334, in clone
    dest_repo.clone(src_repo, heads=revs, stream=stream)
  File "/usr/lib/pymodules/python2.6/mercurial/localrepo.py", line 1853, in clone
    return self.pull(remote, heads)
  File "/media/links/dev/hgsubversion/hgsubversion/svnrepo.py", line 48, in wrapper
    return fn(self, *args, **opts)
  File "/media/links/dev/hgsubversion/hgsubversion/svnrepo.py", line 63, in pull
    return wrappers.pull(self, remote, heads, force)
  File "/media/links/dev/hgsubversion/hgsubversion/wrappers.py", line 223, in pull
    svn_url = source.svnurl
  File "/media/links/dev/hgsubversion/hgsubversion/svnrepo.py", line 100, in svnurl
    return self.svn.svn_url
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 163, in __get__
    result = self.func(obj)
  File "/media/links/dev/hgsubversion/hgsubversion/svnrepo.py", line 105, in svn
    return svnwrap.SubversionRepo(*self.svnauth)
  File "/media/links/dev/hgsubversion/hgsubversion/svnwrap/subvertpy_wrapper.py", line 176, in __init__
    self.init_ra_and_client()
  File "/media/links/dev/hgsubversion/hgsubversion/svnwrap/subvertpy_wrapper.py", line 227, in init_ra_and_client
    auth=auth)
  File "/usr/lib/pymodules/python2.6/subvertpy/ra.py", line 47, in RemoteAccess
    return url_handlers[type](url, *args, **kwargs)
subvertpy.SubversionException: ("OPTIONS of 'https://svn.myserver.org/mysvn': authorization failed: Could not authenticate to server: rejected Basic challenge (https://svn.myserver.org)", 170001)

Comments (22)

  1. Dan Villiom Podlaski Christiansen

    The first failure you see is expected: ‘ssh’ URLs aren't considered for Subversion support, as Subversion itself doesn't recognize those. As you saw, ‘svn+ssh’ will work.

    The second failure is due to a conflict between regular Mercurial and Subversion support. When you try to access a URL with ‘http’, Mercurial support will be attempted first and only if that fails, we fall back to Subversion support.

    The third failure is arguably a bug, but I can't reproduce it here. You should note that you're using the SWIG bindings, as your Subvertpy installation is too old. The 1.2 release requires 0.7.4 or later. Could you please paste the output of ‘hg version --svn’?

  2. phobie

    When you try to access a URL with ‘http’

    http is not an option for a password protected repository

    You should note that you're using the SWIG bindings

    I did not know that something uses swig bindings

    as your Subvertpy installation is too old

    0.7.5 seems to be the latest release...

    Could you please paste the output of ‘hg version --svn’?

    I use default Debian/Unstable versions. See http://packages.debian.org/ !

    hgsubversion has been pulled from https://bitbucket.org/durin42/hgsubversion

    $ LANG=C hg version --svn
    Mercurial Distributed SCM (version 1.6.4)
    [...]
    hgsubversion: bf1c27a89c76
    Subversion: 1.6.12
    bindings: Subvertpy 0.7.5
    
  3. cspann

    It seems that I have a similar bug...

    spann@host:~/$ hg clone svn+https://*snip*
    ** unknown exception encountered, please report by visiting
    **  http://mercurial.selenic.com/wiki/BugTracker
    ** Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) [GCC 4.4.5]
    ** Mercurial Distributed SCM (version 1.8.3)
    ** Extensions loaded: hgsubversion, rebase, mq, hgshelve, transplant
    Traceback (most recent call last):
      File "/opt/spann/bin/hg", line 38, in <module>
        mercurial.dispatch.run()
      File "/opt/spann/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run
        sys.exit(dispatch(sys.argv[1:]))
      File "/opt/spann/lib/python2.6/site-packages/mercurial/dispatch.py", line 36, in dispatch
        return _runcatch(u, args)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/dispatch.py", line 58, in _runcatch
        return _dispatch(ui, args)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/dispatch.py", line 601, in _dispatch
        cmdpats, cmdoptions)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/dispatch.py", line 406, in runcommand
        ret = _runcommand(ui, options, cmd, d)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/dispatch.py", line 655, in _runcommand
        return checkargs()
      File "/opt/spann/lib/python2.6/site-packages/mercurial/dispatch.py", line 609, in checkargs
        return cmdfunc()
      File "/opt/spann/lib/python2.6/site-packages/mercurial/dispatch.py", line 598, in <lambda>
        d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/util.py", line 433, in check
        return func(*args, **kwargs)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/extensions.py", line 133, in wrap
        util.checksignature(origfn), *args, **kwargs)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/util.py", line 433, in check
        return func(*args, **kwargs)
      File "/home/sikanda/spann/apps/hgsvn/hgsubversion/wrappers.py", line 475, in clone
        orig(ui, source, dest, **opts)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/util.py", line 433, in check
        return func(*args, **kwargs)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/commands.py", line 825, in clone
        branch=opts.get('branch'))
      File "/opt/spann/lib/python2.6/site-packages/mercurial/extensions.py", line 178, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/home/sikanda/spann/apps/hgsvn/hgsubversion/wrappers.py", line 466, in hgclonewrapper
        data['srcrepo'], data['dstrepo'] = orig(ui, origsource, dest, **opts)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/hg.py", line 335, in clone
        dest_repo.clone(src_repo, heads=revs, stream=stream)
      File "/opt/spann/lib/python2.6/site-packages/mercurial/localrepo.py", line 2014, in clone
        return self.pull(remote, heads)
      File "/home/sikanda/spann/apps/hgsvn/hgsubversion/svnrepo.py", line 48, in wrapper
        return fn(self, *args, **opts)
      File "/home/sikanda/spann/apps/hgsvn/hgsubversion/svnrepo.py", line 63, in pull
        return wrappers.pull(self, remote, heads, force)
      File "/home/sikanda/spann/apps/hgsvn/hgsubversion/wrappers.py", line 244, in pull
        svn_url = source.svnurl
      File "/home/sikanda/spann/apps/hgsvn/hgsubversion/svnrepo.py", line 100, in svnurl
        return self.svn.svn_url
      File "/opt/spann/lib/python2.6/site-packages/mercurial/util.py", line 169, in __get__
        result = self.func(obj)
      File "/home/sikanda/spann/apps/hgsvn/hgsubversion/svnrepo.py", line 105, in svn
        return svnwrap.SubversionRepo(*self.svnauth)
      File "/home/sikanda/spann/apps/hgsvn/hgsubversion/svnwrap/subvertpy_wrapper.py", line 176, in __init__
        self.init_ra_and_client()
      File "/home/sikanda/spann/apps/hgsvn/hgsubversion/svnwrap/subvertpy_wrapper.py", line 227, in init_ra_and_client
        auth=auth)
      File "/home/sikanda/spann/.local/lib/python2.6/site-packages/subvertpy/ra.py", line 47, in RemoteAccess
        return url_handlers[type](url, *args, **kwargs)
    subvertpy.SubversionException: ("OPTIONS of '*snip*': authorization failed: Could not authenticate to server: rejected Basic challenge (*snip*)", 170001)
    

    spann@host:/$ hg version --svn Mercurial Distributed SCM (version 1.8.3) (see http://mercurial.selenic.com for more information)

    Copyright (C) 2005-2011 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    hgsubversion: 1.2.1+20-800d293f907d+20110524 Subversion: 1.6.12 bindings: Subvertpy 0.7.4

    Subvertpy 0.7.4 should be fine?

  4. Anonymous

    Same Problem here:

    hg clone svn+https://svn.somewhere.com/repos/somerepo
    Zielverzeichnis: somerepo
    ** unknown exception encountered, please report by visiting
    **  http://mercurial.selenic.com/wiki/BugTracker
    ** Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) [GCC 4.5.2]
    ** Mercurial Distributed SCM (version 1.7.5)
    ** Erweiterungen geladen: hgsubversion, color, parentrevspec
    Traceback (most recent call last):
      File "/usr/bin/hg", line 38, in <module>
        mercurial.dispatch.run()
      File "/usr/lib/pymodules/python2.7/mercurial/dispatch.py", line 16, in run
        sys.exit(dispatch(sys.argv[1:]))
      File "/usr/lib/pymodules/python2.7/mercurial/dispatch.py", line 36, in dispatch
        return _runcatch(u, args)
      File "/usr/lib/pymodules/python2.7/mercurial/dispatch.py", line 58, in _runcatch
        return _dispatch(ui, args)
      File "/usr/lib/pymodules/python2.7/mercurial/dispatch.py", line 593, in _dispatch
        cmdpats, cmdoptions)
      File "/usr/lib/pymodules/python2.7/mercurial/dispatch.py", line 401, in runcommand
        ret = _runcommand(ui, options, cmd, d)
      File "/usr/lib/pymodules/python2.7/mercurial/extensions.py", line 175, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/usr/lib/pymodules/python2.7/hgext/color.py", line 223, in colorcmd
        return orig(ui_, opts, cmd, cmdfunc)
      File "/usr/lib/pymodules/python2.7/mercurial/dispatch.py", line 644, in _runcommand
        return checkargs()
      File "/usr/lib/pymodules/python2.7/mercurial/dispatch.py", line 598, in checkargs
        return cmdfunc()
      File "/usr/lib/pymodules/python2.7/mercurial/dispatch.py", line 591, in <lambda>
        d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
      File "/usr/lib/pymodules/python2.7/mercurial/util.py", line 426, in check
        return func(*args, **kwargs)
      File "/usr/lib/pymodules/python2.7/mercurial/extensions.py", line 130, in wrap
        util.checksignature(origfn), *args, **kwargs)
      File "/usr/lib/pymodules/python2.7/mercurial/util.py", line 426, in check
        return func(*args, **kwargs)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 486, in clone
        orig(ui, source, dest, **opts)
      File "/usr/lib/pymodules/python2.7/mercurial/util.py", line 426, in check
        return func(*args, **kwargs)
      File "/usr/lib/pymodules/python2.7/mercurial/commands.py", line 732, in clone
        branch=opts.get('branch'))
      File "/usr/lib/pymodules/python2.7/mercurial/extensions.py", line 175, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 477, in hgclonewrapper
        data['srcrepo'], data['dstrepo'] = orig(ui, *args, **opts)
      File "/usr/lib/pymodules/python2.7/mercurial/hg.py", line 337, in clone
        dest_repo.clone(src_repo, heads=revs, stream=stream)
      File "/usr/lib/pymodules/python2.7/mercurial/localrepo.py", line 1886, in clone
        return self.pull(remote, heads)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 48, in wrapper
        return fn(self, *args, **opts)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 63, in pull
        return wrappers.pull(self, remote, heads, force)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 245, in pull
        svn_url = source.svnurl
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 100, in svnurl
        return self.svn.svn_url
      File "/usr/lib/pymodules/python2.7/mercurial/util.py", line 169, in __get__
        result = self.func(obj)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 105, in svn
        return svnwrap.SubversionRepo(*self.svnauth)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnwrap/subvertpy_wrapper.py", line 176, in __init__
        self.init_ra_and_client()
      File "/home/christian/hg/hgsubversion/hgsubversion/svnwrap/subvertpy_wrapper.py", line 227, in init_ra_and_client
        auth=auth)
      File "/usr/lib/python2.7/dist-packages/subvertpy/ra.py", line 47, in RemoteAccess
        return url_handlers[type](url, *args, **kwargs)
    subvertpy.SubversionException: ("OPTIONS of 'https://svn.somewhere.com/repos/somerepo': authorization failed: Could not authenticate to server: rejected Basic challenge (https://svn.somewhere.com)", 170001)
    

    Versions are:

    hg version --svn
    
    Mercurial Distributed SCM (version 1.7.5)
    (see http://mercurial.selenic.com for more information)
    
    Copyright (C) 2005-2010 Matt Mackall and others
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    hgsubversion: 1.2.1+34-f28e0f54a6ef
    Subversion: 1.6.12
    bindings: Subvertpy 0.8.3
    
    
  5. Anonymous

    (not sure if my previous comment did it, so writing again)

    Workaround that fixed the problem for me: perform "svn checkout" on the same repository (make sure it caches your credentials) before performing "hg clone svn+http".

  6. Christian Eiden

    No, it does no work for me.

    Current System:

    hg version --svn Mercurial Distributed SCM (version 1.9.1) (see http://mercurial.selenic.com for more information)

    Copyright (C) 2005-2011 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    hgsubversion: 1.2.1+34-f28e0f54a6ef Subversion: 1.6.12 bindings: Subvertpy 0.8.3

  7. Christian Eiden

    Current Test on the latest Ubuntu 11.10 Beta

    christian@ceiden-vmx:~/test$ hg clone svn+https://svn.somehost.com/repos/some-repo/
    Zielverzeichnis: some-repo
    ** unknown exception encountered, please report by visiting
    **  http://mercurial.selenic.com/wiki/BugTracker
    ** Python 2.7.2+ (default, Oct  4 2011, 20:06:09) [GCC 4.6.1]
    ** Mercurial Distributed SCM (version 1.9.1)
    ** Erweiterungen geladen: hgsubversion, color
    Traceback (most recent call last):
      File "/usr/bin/hg", line 38, in <module>
        mercurial.dispatch.run()
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 27, in run
        sys.exit(dispatch(request(sys.argv[1:])))
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 64, in dispatch
        return _runcatch(req)
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
        return _dispatch(req)
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 679, in _dispatch
        cmdpats, cmdoptions)
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 454, in runcommand
        ret = _runcommand(ui, options, cmd, d)
      File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 182, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/hgext/color.py", line 368, in colorcmd
        return orig(ui_, opts, cmd, cmdfunc)
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 733, in _runcommand
        return checkargs()
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 687, in checkargs
        return cmdfunc()
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 676, in <lambda>
        d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
      File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 385, in check
        return func(*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 137, in wrap
        util.checksignature(origfn), *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 385, in check
        return func(*args, **kwargs)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 486, in clone
        orig(ui, source, dest, **opts)
      File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 385, in check
        return func(*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 1041, in clone
        branch=opts.get('branch'))
      File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 182, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 477, in hgclonewrapper
        data['srcrepo'], data['dstrepo'] = orig(ui, *args, **opts)
      File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 334, in clone
        destrepo.clone(srcrepo, heads=revs, stream=stream)
      File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 1946, in clone
        return self.pull(remote, heads)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 48, in wrapper
        return fn(self, *args, **opts)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 63, in pull
        return wrappers.pull(self, remote, heads, force)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 245, in pull
        svn_url = source.svnurl
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 100, in svnurl
        return self.svn.svn_url
      File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 169, in __get__
        result = self.func(obj)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 105, in svn
        return svnwrap.SubversionRepo(*self.svnauth)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnwrap/subvertpy_wrapper.py", line 176, in __init__
        self.init_ra_and_client()
      File "/home/christian/hg/hgsubversion/hgsubversion/svnwrap/subvertpy_wrapper.py", line 227, in init_ra_and_client
        auth=auth)
      File "/usr/lib/python2.7/dist-packages/subvertpy/ra.py", line 47, in RemoteAccess
        return url_handlers[type](url, *args, **kwargs)
    subvertpy.SubversionException: ("OPTIONS of 'https://svn.somehost.com/repos/some-repo': authorization failed: Could not authenticate to server: rejected Basic challenge (https://svn.somehost.com)", 170001)
    Error in sys.excepthook:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 59, in apport_excepthook
        from apport.fileutils import likely_packaged
      File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 85, in _demandimport
        return _origimport(name, globals, locals, fromlist)
      File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
        from apport.report import Report
      File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 109, in _demandimport
        mod = _origimport(name, globals, locals)
      File "/usr/lib/python2.7/dist-packages/apport/report.py", line 148, in <module>
        class Report(problem_report.ProblemReport):
      File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 75, in __getattribute__
        self._load()
      File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 47, in _load
        mod = _origimport(head, globals, locals)
      File "/usr/lib/python2.7/dist-packages/problem_report.py", line 93, in <module>
        class ProblemReport(UserDict):
    TypeError: Error when calling the metaclass bases
        module.__init__() takes at most 2 arguments (3 given)
    
    Original exception was:
    Traceback (most recent call last):
      File "/usr/bin/hg", line 38, in <module>
        mercurial.dispatch.run()
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 27, in run
        sys.exit(dispatch(request(sys.argv[1:])))
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 64, in dispatch
        return _runcatch(req)
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
        return _dispatch(req)
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 679, in _dispatch
        cmdpats, cmdoptions)
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 454, in runcommand
        ret = _runcommand(ui, options, cmd, d)
      File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 182, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/hgext/color.py", line 368, in colorcmd
        return orig(ui_, opts, cmd, cmdfunc)
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 733, in _runcommand
        return checkargs()
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 687, in checkargs
        return cmdfunc()
      File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 676, in <lambda>
        d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
      File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 385, in check
        return func(*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 137, in wrap
        util.checksignature(origfn), *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 385, in check
        return func(*args, **kwargs)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 486, in clone
        orig(ui, source, dest, **opts)
      File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 385, in check
        return func(*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 1041, in clone
        branch=opts.get('branch'))
      File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 182, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 477, in hgclonewrapper
        data['srcrepo'], data['dstrepo'] = orig(ui, *args, **opts)
      File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 334, in clone
        destrepo.clone(srcrepo, heads=revs, stream=stream)
      File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 1946, in clone
        return self.pull(remote, heads)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 48, in wrapper
        return fn(self, *args, **opts)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 63, in pull
        return wrappers.pull(self, remote, heads, force)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 245, in pull
        svn_url = source.svnurl
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 100, in svnurl
        return self.svn.svn_url
      File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 169, in __get__
        result = self.func(obj)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 105, in svn
        return svnwrap.SubversionRepo(*self.svnauth)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnwrap/subvertpy_wrapper.py", line 176, in __init__
        self.init_ra_and_client()
      File "/home/christian/hg/hgsubversion/hgsubversion/svnwrap/subvertpy_wrapper.py", line 227, in init_ra_and_client
        auth=auth)
      File "/usr/lib/python2.7/dist-packages/subvertpy/ra.py", line 47, in RemoteAccess
        return url_handlers[type](url, *args, **kwargs)
    subvertpy.SubversionException: ("OPTIONS of 'https://svn.somehost.com/repos/some-repo': authorization failed: Could not authenticate to server: rejected Basic challenge (https://svn.somehost.com)", 170001)
    
    christian@ceiden-vmx:~/test$ hg version --svn
    Mercurial Distributed SCM (version 1.9.1)
    (see http://mercurial.selenic.com for more information)
    
    Copyright (C) 2005-2011 Matt Mackall and others
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    hgsubversion: 1.2.1+34-f28e0f54a6ef
    Subversion: 1.6.12
    bindings: Subvertpy 0.8.3
    
    
  8. Christian Eiden

    Againg, with 1.8.4

    christian@ceiden-vmx:~/test$ hg clone svn+https://svn.somehost.com/repos/some-repo
    destination directory: some-repo
    ** unknown exception encountered, please report by visiting
    **  http://mercurial.selenic.com/wiki/BugTracker
    ** Python 2.7.2+ (default, Oct  4 2011, 20:06:09) [GCC 4.6.1]
    ** Mercurial Distributed SCM (version 1.8.4)
    ** Extensions loaded: hgsubversion, color, parentrevspec
    Traceback (most recent call last):
      File "/home/christian/bin/hg", line 38, in <module>
        mercurial.dispatch.run()
      File "/home/christian/lib/python/mercurial/dispatch.py", line 16, in run
        sys.exit(dispatch(sys.argv[1:]))
      File "/home/christian/lib/python/mercurial/dispatch.py", line 36, in dispatch
        return _runcatch(u, args)
      File "/home/christian/lib/python/mercurial/dispatch.py", line 58, in _runcatch
        return _dispatch(ui, args)
      File "/home/christian/lib/python/mercurial/dispatch.py", line 601, in _dispatch
        cmdpats, cmdoptions)
      File "/home/christian/lib/python/mercurial/dispatch.py", line 406, in runcommand
        ret = _runcommand(ui, options, cmd, d)
      File "/home/christian/lib/python/mercurial/extensions.py", line 178, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/home/christian/lib/python/hgext/color.py", line 223, in colorcmd
        return orig(ui_, opts, cmd, cmdfunc)
      File "/home/christian/lib/python/mercurial/dispatch.py", line 655, in _runcommand
        return checkargs()
      File "/home/christian/lib/python/mercurial/dispatch.py", line 609, in checkargs
        return cmdfunc()
      File "/home/christian/lib/python/mercurial/dispatch.py", line 598, in <lambda>
        d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
      File "/home/christian/lib/python/mercurial/util.py", line 433, in check
        return func(*args, **kwargs)
      File "/home/christian/lib/python/mercurial/extensions.py", line 133, in wrap
        util.checksignature(origfn), *args, **kwargs)
      File "/home/christian/lib/python/mercurial/util.py", line 433, in check
        return func(*args, **kwargs)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 486, in clone
        orig(ui, source, dest, **opts)
      File "/home/christian/lib/python/mercurial/util.py", line 433, in check
        return func(*args, **kwargs)
      File "/home/christian/lib/python/mercurial/commands.py", line 825, in clone
        branch=opts.get('branch'))
      File "/home/christian/lib/python/mercurial/extensions.py", line 178, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 477, in hgclonewrapper
        data['srcrepo'], data['dstrepo'] = orig(ui, *args, **opts)
      File "/home/christian/lib/python/mercurial/hg.py", line 335, in clone
        dest_repo.clone(src_repo, heads=revs, stream=stream)
      File "/home/christian/lib/python/mercurial/localrepo.py", line 2027, in clone
        return self.pull(remote, heads)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 48, in wrapper
        return fn(self, *args, **opts)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 63, in pull
        return wrappers.pull(self, remote, heads, force)
      File "/home/christian/hg/hgsubversion/hgsubversion/wrappers.py", line 245, in pull
        svn_url = source.svnurl
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 100, in svnurl
        return self.svn.svn_url
      File "/home/christian/lib/python/mercurial/util.py", line 169, in __get__
        result = self.func(obj)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnrepo.py", line 105, in svn
        return svnwrap.SubversionRepo(*self.svnauth)
      File "/home/christian/hg/hgsubversion/hgsubversion/svnwrap/subvertpy_wrapper.py", line 176, in __init__
        self.init_ra_and_client()
      File "/home/christian/hg/hgsubversion/hgsubversion/svnwrap/subvertpy_wrapper.py", line 227, in init_ra_and_client
        auth=auth)
      File "/usr/lib/python2.7/dist-packages/subvertpy/ra.py", line 47, in RemoteAccess
        return url_handlers[type](url, *args, **kwargs)
    subvertpy.SubversionException: ("OPTIONS of 'https://svn.somehost.com/repos/some-repo': authorization failed: Could not authenticate to server: rejected Basic challenge (https://svn.somehost.com)", 170001)
    
    christian@ceiden-vmx:~/test$ hg version --svn
    Mercurial Distributed SCM (version 1.8.4)
    (see http://mercurial.selenic.com for more information)
    
    Copyright (C) 2005-2011 Matt Mackall and others
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    hgsubversion: 1.2.1+34-f28e0f54a6ef
    Subversion: 1.6.12
    bindings: Subvertpy 0.8.3
    
  9. Anshuman Bhaduri

    I got the same error as Christian Eiden as well (with Python 2.7.2) when running hg clone --startrev HEAD svn+http://some/repo/trunk trunk.

    [anshumanb@anshumanb trunk]$ hg version --svn
    Mercurial Distributed SCM (version 1.9.3)
    *snip*
    hgsubversion: 1.2.1+48-0cbf9fd89672
    Subversion: 1.6.17
    bindings: Subvertpy 0.8.5
    

    For me,

    rm ~/.gnome2/keyrings/login.keyring
    

    did the trick. (source)

    Now this works!

    hg clone --startrev HEAD svn+http://some/repo/trunk trunk
    
  10. Anonymous

    I had the same bug: Could not authenticate to server: rejected Basic challenge (https://CENSORED) (SVN_ERR_RA_NOT_AUTHORIZED)

    I did

    mv ~/.gnome2/keyrings ~/.gnome2/foo
    

    because I did not want to destroy any unknown files. It started working again...

    This bug really seems related to (gnome) keyring stuff.

  11. Anonymous

    same problem here:

    $ hg version --svn
    Mercurial Distributed SCM (version 1.4.3)
    
    Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    hgsubversion: unknown
    Subversion: 1.6.6
    bindings: Subvertpy 0.8.11
    
  12. Tom Anderson

    I also saw this problem.

    However, in my case, the cause was nothing to do with hgsubversion. I had two GNOME sessions running on the same machine - one on my physical display, and one on a virtual display under NX. In one of them, i could push, but in the other, i couldn't. I believe the problem was that only one GNOME session can access the GNOME keyring at a time, and in the session which could not access the keyring, hgsubversion could not obtain my credentials.

    It would be great if hgsubversion could detect this situation and report it, but it seems likely that this is happening down in the guts of Subversion itself.

  13. Jan-Philip Gehrcke

    In the situation where you can clone/pull without requiring credentials but upon write (push) login is required, I receive the same traceback as the others here (final bits):

      File "/usr/lib/python2.7/dist-packages/hgext/hgsubversion/pushmod.py", line 197, in commit
        props, newcopies)
      File "/usr/lib/python2.7/dist-packages/hgext/hgsubversion/svnwrap/subvertpy_wrapper.py", line 345, in commit
        commiteditor = self.remote.get_commit_editor(revprops, commitcb)
    subvertpy.SubversionException: ("MKACTIVITY of '/!svn/act/0a31a0f8-d7f2-45b7-9f67-3cf9d53a585d': authorization failed: Could not authenticate to server: rejected Basic challenge (https://plugins.svn.wordpress.org)", 170001)
    

    This is a very simple Wheezy-Setup (without desktop environment) -- how can I define the credentials to be used upon push?

  14. Jan-Philip Gehrcke

    Ah, in subvertpy_wrapper.py I saw that URL credentials become parsed, so I added my credentials in plaintext in .hg/hgrc like so:

    [paths]
    default = svn+https://user:pass@svn.server.org/location/
    

    This worked.

  15. Jan-Philip Gehrcke

    I would be happy to not be required to store may credentials in plain text, so I am not sure if this one really is resolved. The setup is pretty basic in my case. It's a WordPress plugin SVN repo where the public has read access, so checkout went fine. After local change, push was affected by the issue described above. No proxy in between.

  16. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.