1. Augie Fackler
  2. hg-git
  3. Issues
Issue #61 resolved

[Solved] Issues when trying to clone private (SSH) Bitbucket Git repository

FlorianGeorge
created an issue

I am struggling to clone a private Bitbucket Git repository under tortoiseHg, and also command line hg.

Created an ssh key with puttygen, added it in the tortoiseHg pageant, tried numerous variations of the pull requests.

Most of them just failed with various server sided error messages, here are the last two ones, the second one putting out an exception.

Am I just doing it wrong?

hg clone ssh://hg@bitbucket.org/FlorianGeorge/game-programming-ws12-13-git.git
remote: Looking up host "bitbucket.org"
remote: Connecting to 207.223.240.182 port 22
remote: We claim version: SSH-2.0-PuTTY_Local:_Feb__4_2012_13:00:34
remote: Server version: SSH-2.0-OpenSSH_5.3
remote: Using SSH protocol version 2
remote: Server supports delayed compression; will try this later
remote: Doing Diffie-Hellman group exchange
remote: Doing Diffie-Hellman key exchange with hash SHA-256
remote: Host key fingerprint is:
remote: ssh-rsa 2048 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40
remote: Initialised AES-256 SDCTR client->server encryption
remote: Initialised HMAC-SHA1 client->server MAC algorithm
remote: Initialised AES-256 SDCTR server->client encryption
remote: Initialised HMAC-SHA1 server->client MAC algorithm
remote: Pageant is running. Requesting keys.
remote: Pageant has 1 SSH-2 keys
remote: Using username "hg".
remote: Trying Pageant key #0
remote: Remote debug message: Forced command: conq username:FlorianGeorge
remote: Remote debug message: Port forwarding disabled.
remote: Remote debug message: X11 forwarding disabled.
remote: Remote debug message: Agent forwarding disabled.
remote: Remote debug message: Pty allocation disabled.
remote: Authenticating with public key "rsa-key-20121201" from agent
remote: Sending Pageant's response
remote: Remote debug message: Forced command: conq username:FlorianGeorge
remote: Remote debug message: Port forwarding disabled.
remote: Remote debug message: X11 forwarding disabled.
remote: Remote debug message: Agent forwarding disabled.
remote: Remote debug message: Pty allocation disabled.
remote: Access granted
remote: Initiating key re-exchange (enabling delayed compression)
remote: Doing Diffie-Hellman group exchange
remote: Doing Diffie-Hellman key exchange with hash SHA-256
remote: Initialised AES-256 SDCTR client->server encryption
remote: Initialised HMAC-SHA1 client->server MAC algorithm
remote: Initialised zlib (RFC1950) compression
remote: Initialised AES-256 SDCTR server->client encryption
remote: Initialised HMAC-SHA1 server->client MAC algorithm
remote: Initialised zlib (RFC1950) decompression
remote: Opened channel for session
remote: Started a shell/command
remote: conq: repository does not exist.
remote: Server sent command exit status 0
remote: Disconnected: All channels closed
abort: no suitable response from remote hg!
hg clone git+ssh://hg@bitbucket.org/FlorianGeorge/game-programming-ws12-13-git.git
destination directory: game-programming-ws12-13-git
["git-upload-pack '/FlorianGeorge/game-programming-ws12-13-git.git'"]
** Unknown exception encountered with possibly-broken third-party extension hggit
** which supports versions 2.3.1 of Mercurial.
** Please disable hggit and try your action again.
** If that fixes the bug please report it to https://bitbucket.org/durin42/hg-git/issues
** Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (version 2.4+6-35ba170c0f82)
** Extensions loaded: hggit
Traceback (most recent call last):
  File "hg", line 42, in <module>
  File "mercurial\dispatch.pyo", line 28, in run
  File "mercurial\dispatch.pyo", line 65, in dispatch
  File "mercurial\dispatch.pyo", line 88, in _runcatch
  File "mercurial\dispatch.pyo", line 741, in _dispatch
  File "mercurial\dispatch.pyo", line 514, in runcommand
  File "mercurial\dispatch.pyo", line 831, in _runcommand
  File "mercurial\dispatch.pyo", line 802, in checkargs
  File "mercurial\dispatch.pyo", line 738, in <lambda>
  File "mercurial\util.pyo", line 472, in check
  File "mercurial\commands.pyo", line 1220, in clone
  File "mercurial\hg.pyo", line 381, in clone
  File "mercurial\localrepo.pyo", line 2582, in clone
  File "\Project\hg-git\hggit\hgrepo.py", line 14, in pull
    return git.fetch(remote.path, heads)
  File "\Project\hg-git\hggit\git_handler.py", line 204, in fetch
    refs = self.fetch_pack(remote, heads)
  File "\Project\hg-git\hggit\git_handler.py", line 1002, in fetch_pack
    f.write, progress.progress)
  File "dulwich\client.pyo", line 471, in fetch_pack
  File "dulwich\client.pyo", line 172, in _read_refs
TypeError: 'NoneType' object is not iterable

Comments (10)

  1. FlorianGeorge reporter

    I tried to access the repository with the same private key via tortoiseGit and it worked without a problem, so the repository and the SSH-2 key appear to be set up correctly.

  2. Ewen Wallace

    +1. I've had ZERO success with anything using SSH. Public read-only repos are fine - SSH is broken. Cloning via Git works fine.

    [edit] - I'm retarded. I can't read instructions. Even easy ones. I left out the "git@" in git+ssh://git@bitbucket.org/cadbloke/test-git.git.

    Herp. Derp. Sorry. Carry on, I promise to read your instructions properly from now on.

  3. FlorianGeorge reporter

    The suggested Bitbucket clone line

    git clone git@bitbucket.org:UserName/RepositoryName.git
    

    needs to be translated to

    hg clone --verbose git+ssh://git@bitbucket.org/UserName/RepositoryName.git TargetDirectory
    

    for it to work.

  4. Log in to comment