Issue #2004 resolved

hg push always asks for http authorization, even with ssh

Michael Pitra
created an issue

After doing some first hg push, I edited a few more files and hg pushed once more: {{{ crea@alpha:~/devel/moneyguru$ hg push Enter passphrase for key '/home/crea/.ssh/id_rsa': pushing to ssh://hg@bitbucket.org/some/repo pushing subrepo lib searching for changes http authorization required realm: Bitbucket.org HTTP user: crea password: abort: authorization failed }}} But now, there is always this "http authorization required" thing, even when I do not use hg via HTTPS. What's wrong here?

(Note: my first commit/push was with an https repository, there it worked without problems).

Comments (31)

  1. Michael Pitra reporter

    Yes, the lines are copy&pasted directly from console. I even deleted the (formerly checked out using HTTPS) repository and cloned it via SSH from scratch.

  2. Michael Pitra reporter

    Hm, same again. Am I doing something wrong? What confuses me is, that he asks for my username - this was not the case on my first (successful) and only commit. Btw, this is not my repository, I'm just a follower with write rights.

  3. Jesper Nøhr

    It's gone from support to just pissing me off. There's no reason why this is happening.

    When it asks you for the username, is that a prompt? I.e. can you type anything there, or does it just blow past?

  4. Michael Pitra reporter

    In fact, this is a prompt. I enter "crea" (as my bitbucket username), and then "password:" is another prompt; I enter my bitbucket password. Shall I omit those things?

  5. Michael Pitra reporter

    That's coming also when I do SSH.

    The only difference between SSH and HTTPS is the .hg/hgrc entry in the repository, isn't it? Edited with two different values results to:

    pushing to ssh://hg@bitbucket.org/hsoft/moneyguru
    

    vs.

    pushing to https://crea@bitbucket.org/hsoft/moneyguru
    
  6. Michael Pitra reporter

    Funny. This seems to work:

    • create a new repository in bitbucket
    • clone via ssh
    • touch / add a file
    • commit / push
    • touch / add a second file
    • commit / push

    Everything went ok.

    Is it possible that when being a follower (and committer) then something goes in another direction?

  7. Jesper Nøhr

    You know, I'm not entirely sure what went wrong here. The symptoms you describe are incredibly absurd. Even after disabling the hook, it still gets presented to you, and what's more, you get HTTP stuff output in your SSH session.

    I've never seen anything like it.

  8. Michael Pitra reporter

    Fascinating. Doing an strace showed me, that there are some open()'s to the hgrc in the subrepos, and there are other path references pointing to some HTTP URLs.

    Could this be the problem? Maybe you have a look on it - e.g. to the subrepo hsoft/moneyguru/cocoalib/.hg/hgrc?

  9. Michael Pitra reporter

    Hmm, this could be the issue here. My first commit was to the subdir "cocoa", but that is not a subrepo, so it used the parents hgrc (https/ssh). This commit worked.

    The second commit was to the subrepo "cocoalib", where the hgrc points to some HTTP URL (not HTTPS!), which is a CNAME for bitbucket.org.

  10. Michael Pitra reporter

    Ok, seems to work now.

    • I had no write permissions on the subrepo, so maybe this was bringing up the authorization failed message
    • Mixed configuration between main repo and subrepo's led to strange results
    • pushing with the correct SSH URL worked (after I got write permissions)

    Setting issue to fixed now - thanks for your time and efforts ;)

  11. Log in to comment