Push having problem of Authorization failed with correct credential. (BB-12392)

Issue #11099 resolved
Arun Chauhan created an issue

I am facing problem while pushing with correct credential and its shows authorization failed most of the time. For every push its taking 10-15 tries which is very irritating. Sometimes commit got pushed but console shows an error for authorization failed, I am helpless please help me for this regard

Comments (20)

  1. BuildMachine YNAB

    We are also affected. This was reported on the Tortoise issue tracker here: https://bitbucket.org/tortoisehg/thg/issue/3707/abort-authorization-failed-when-trying-to

    To be clear, this is not a case of bad credentials. Other Other commands like hg outgoing hg pull all work correctly.

    Here are two logs (as copied from that case):

    C:\work\LavaBlast>hg push --debug --traceback
    pushing to https://bitbucket.org/repo/repo
    using https://bitbucket.org/repo/repo
    sending capabilities command
    using auth.bb.* for authentication
    bitbucket.org certificate successfully verified
    using auth.bb.* for authentication
    http auth: user ******, password ************
    using auth.bb.* for authentication
    bitbucket.org certificate successfully verified
    query 1; heads
    sending batch command
    using auth.bb.* for authentication
    searching for changes
    all remote heads known locally
    preparing listkeys for "phases"
    sending listkeys command
    using auth.bb.* for authentication
    checking for updated bookmarks
    preparing listkeys for "bookmarks"
    sending listkeys command
    using auth.bb.* for authentication
    sending branchmap command
    using auth.bb.* for authentication
    sending branchmap command
    using auth.bb.* for authentication
    preparing listkeys for "bookmarks"
    sending listkeys command
    using auth.bb.* for authentication
    1 changesets found
    list of changesets:
    76c25843a0ff3e1fb44837493cc7270ff6702be4
    bundling: 1/1 changesets (100.00%)
    bundling: 1/1 manifests (100.00%)
    bundling: FranchiseBlast/App_Data/FranchiseBlast.XML 1/12 files (8.33%)
    bundling: FranchiseBlast/FranchiseBlast.csproj 2/12 files (16.67%)
    bundling: FranchiseBlast/Pages/crmForms.aspx.cs 3/12 files (25.00%)
    bundling: FranchiseBlast/UserControls/Content/SurveyCrm/SurveyCrmEditor.ascx.cs
    4/12 files (33.33%)
    bundling: FranchiseBlast/UserControls/Content/SurveyCrm/SurveyCrmList.ascx 5/12
    files (41.67%)
    bundling: FranchiseBlast/UserControls/Content/SurveyCrm/SurveyCrmList.ascx.cs 6/
    12 files (50.00%)
    bundling: FranchiseBlast/UserControls/Content/SurveyCrm/SurveyCrmList.ascx.desig
    ner.cs 7/12 files (58.33%)
    bundling: FranchiseBlast/Views/Crm/Index.cshtml 8/12 files (66.67%)
    bundling: FranchiseBlast/css/inspinia/style.min.css 9/12 files (75.00%)
    bundling: FranchiseBlast/css/mobile-site.less 10/12 files (83.33%)
    bundling: FranchiseBlast/css/mobile-site.min.css 11/12 files (91.67%)
    bundling: FranchiseBlast/js/controls/SurveyCrm/SurveyCrmEditor.js 12/12 files (1
    00.00%)
    sending unbundle command
    sending 58435 bytes
    using auth.bb.* for authentication
    sending: 57/114 kb (50.00%)
    sending: 57/114 kb (50.00%)
    Traceback (most recent call last):
      File "mercurial\dispatch.pyo", line 140, in _runcatch
      File "mercurial\dispatch.pyo", line 863, in _dispatch
      File "mercurial\dispatch.pyo", line 624, in runcommand
      File "mercurial\dispatch.pyo", line 954, in _runcommand
      File "mercurial\dispatch.pyo", line 925, in checkargs
      File "mercurial\dispatch.pyo", line 860, in <lambda>
      File "mercurial\util.pyo", line 711, in check
      File "mercurial\commands.pyo", line 5115, in push
      File "mercurial\exchange.pyo", line 224, in push
      File "mercurial\exchange.pyo", line 647, in _pushchangeset
      File "mercurial\wireproto.pyo", line 389, in unbundle
      File "mercurial\httppeer.pyo", line 202, in _callpush
      File "mercurial\httppeer.pyo", line 172, in _call
      File "mercurial\httppeer.pyo", line 122, in _callstream
    Abort: authorization failed
    abort: authorization failed
    
    hg push -f --debug --traceback --rev .
    pushing to https://bitbucket.org/ynab/ynabair
    using https://bitbucket.org/ynab/ynabair
    sending capabilities command
    using auth.bb.* for authentication
    bitbucket.org certificate matched fingerprint 45:ad:ae:1a:cf:0e:73:47:06:07:e0:88:f5:cc:10:e5:fa:1c:f7:99
    using auth.bb.* for authentication
    http auth: user buildmachine@youneedabudget.com, password ************
    using auth.bb.* for authentication
    bitbucket.org certificate matched fingerprint 45:ad:ae:1a:cf:0e:73:47:06:07:e0:88:f5:cc:10:e5:fa:1c:f7:99
    query 1; heads
    sending batch command
    using auth.bb.* for authentication
    searching for changes
    all remote heads known locally
    preparing listkeys for "phases"
    sending listkeys command
    using auth.bb.* for authentication
    checking for updated bookmarks
    preparing listkeys for "bookmarks"
    sending listkeys command
    using auth.bb.* for authentication
    1 changesets found
    list of changesets:
    8c4e011e9f0e1c3648eebadba8e027dc1fc87533
    bundling: 1/1 changesets (100.00%)
    bundling: 1/1 manifests (100.00%)
    bundling: YNAB/build/ReleaseNotes.yml 1/1 files (100.00%)
    sending unbundle command
    sending 566 bytes
    using auth.bb.* for authentication
    sending: 0 kb
    sending: 0 kb
    Traceback (most recent call last):
    File "mercurial\dispatch.pyo", line 140, in _runcatch
    File "mercurial\dispatch.pyo", line 863, in _dispatch
    File "mercurial\dispatch.pyo", line 624, in runcommand
    File "mercurial\dispatch.pyo", line 954, in _runcommand
    File "mercurial\dispatch.pyo", line 925, in checkargs
    File "mercurial\dispatch.pyo", line 860, in <lambda>
    File "mercurial\util.pyo", line 711, in check
    File "mercurial\extensions.pyo", line 149, in wrap
    File "mercurial\util.pyo", line 711, in check
    File "hgext\mq.pyo", line 3483, in mqcommand
    File "mercurial\util.pyo", line 711, in check
    File "mercurial\commands.pyo", line 5115, in push
    File "mercurial\exchange.pyo", line 224, in push
    File "mercurial\exchange.pyo", line 647, in _pushchangeset
    File "mercurial\wireproto.pyo", line 389, in unbundle
    File "mercurial\httppeer.pyo", line 202, in _callpush
    File "mercurial\httppeer.pyo", line 172, in _call
    File "mercurial\httppeer.pyo", line 122, in _callstream
    Abort: authorization failed
    abort: authorization failed
    

    It was suggested in that case that we open a bug with Mercurial, as it is not a Tortoise issue. As their system is not allowing me to create an account, and I suspect this might be a BitBucket issue, I'm moving the relevant issues here.

  2. Cristian Cotovan

    Same for me, been happening for the last couple of weeks, credentials are correct. If I keep pushing it eventually works, but fails 99% of the time.

  3. Jesse Yowell Account Deactivated

    Thanks guys -- we're still doing some investigation here to see if the issue is with how we handle authorization. We'll keep you informed if we find anything.

  4. Ryan Williams

    I'm having the same problem...on one of our ten repositories, when I push I am always getting an authorization failed, but the operation does succeed on occasion. The other repositories we have work fine...maybe it's something to do with age?

    Here's my output from hg push --debug (with team and repo name scrubbed):

    pushing to https://drcforbin@bitbucket.org/xxx/xxx
    using https://bitbucket.org/xxx/xxx
    http auth: user drcforbin, password not set
    sending capabilities command
    bitbucket.org certificate successfully verified
    http authorization required for https://bitbucket.org/xxx/xxx
    realm: Bitbucket.org HTTP
    user: drcforbin
    password:
    http auth: user drcforbin, password ********
    bitbucket.org certificate successfully verified
    query 1; heads
    sending batch command
    searching for changes
    all remote heads known locally
    preparing listkeys for "phases"
    sending listkeys command
    checking for updated bookmarks
    preparing listkeys for "bookmarks"
    sending listkeys command
    sending branchmap command
    sending branchmap command
    preparing listkeys for "bookmarks"
    sending listkeys command
    2 changesets found
    list of changesets:
    fbf37b338aa7daec79f132499a484e93e1cdd45d
    5b02f6d34f6ddea8a1187c42a1a3aa84c37d37d7
    bundling: 1/2 changesets (50.00%)
    bundling: 2/2 changesets (100.00%)
    bundling: 1/2 manifests (50.00%)
    bundling: 2/2 manifests (100.00%)
    bundling: .hgtags 1/2 files (50.00%)
    bundling: avserv/gradle.properties 2/2 files (100.00%)
    sending unbundle command
    sending 700 bytes
    sending: 0 kb
    sending: 0 kb
    abort: authorization failed
    

    I ran several times and got the same same output each time, but then one run had the same output but with the last line replaced with the following:

    remote: adding changesets
    remote: adding manifests
    remote: adding file changes
    remote: added 2 changesets with 2 changes to 2 files
    preparing listkeys for "phases"
    sending listkeys command
    preparing pushkey for "phases:5b02f6d34f6ddea8a1187c42a1a3aa84c37d37d7"
    sending pushkey command
    sending 0 bytes
    abort: authorization failed
    

    At this point, the changesets were present in the repository, even though a failure was indicated.

  5. Cristian Cotovan

    I am not sure if any advance has been made on this, but today I've tried to clone a repository onto a new machine, clean install of Hg, Tortoise, etc., and now I cannot complete the clone. If fails about 80% through with the error:

    "Transaction abort. Rollback completed. Abort: stream ended unexpectedly (got 116606 bytes, expected 231948) (this varies). Command returned code 255"

    In fact I get "Command returned code 255" when having those unsuccessful pushes too, on other machines, but now my clone is failing almost everytime. I can't continue working. This is very annoying. Something seems it's losing packets somewhere.

  6. BuildMachine YNAB

    Has there been any progress with this by any chance? Our repository is not usable by our build machine until this is fixed.

  7. Ryan Williams

    I wonder if it's timing related...probably just confirmation bias, but I had a little more luck when I pushed --debug --profile (which slowed it down that little bit)

  8. Jesse Yowell Account Deactivated

    Good news everyone! We found the source of the issue and we'll begin repairing this shortly. We pinpointed the cause to be part of the configuration for the new hardware we rolled out in late February. This configuration piece contained some essential authorization information for hgweb on older repos, so that is why older repos were being affected, but newer repos were working just fine. We'll let you know once we deploy the fix so we can resolve this!

  9. Jesse Yowell Account Deactivated

    We just updated the configuration on our end -- can you guys test and verify?

  10. Scott Weaver

    I just was able to push up code on my first try. I'll let you know if I run into the problem again, but so far so good.

  11. Jesse Yowell Account Deactivated

    Thanks for your patience all, if you still see this occurring, please contact us or reply to this thread.

  12. Log in to comment