56

Since yesterday, bitbucket repository started returning this on any request:

remote: Too many invalid password attempts. Try logging in through the website.  
fatal: unable to access 'https://xxxxxxxxx@bitbucket.org/xxxxxxxxxx/xxxxxxxxxxx.git/': The requested URL returned error: 403

This happens on both the server (trying to git pull) and client (SourceTree on mac).

The user employed on both sides is the same, I can login to bitbucket and see no problems. Both SourceTree and git on the server use different "App Password" generated in bitbucket. I am the only person using this account daily.

I created a new App Password and tried with it just to get the same error.

What can I do to solve the case?

Update #1: Generating a new App Password does not work for both server and client. Re-adding a SourceTree account with Basic authentication does not help too. Bitbucket even does not allow to come to authentication, as it seems - the new App Passwords "Last Access" snows nothing.

Update #2: The accepted answer is indeed a solution. This is quite strange, but resetting the password of the main bitbucket user account works. But the sequence is as follows: reset bitbucket user password; create a new app password for both server and client (SourceTree); for mac, remove the record for bitbucket in KeyChain Access; only try to pull or push from SourceTree after removing the record or the account is locked immediately!

Community
  • 1
  • 1
sunsetjunks
  • 740
  • 1
  • 9
  • 14

14 Answers14

46

The reason for getting the above error is due to Atlassion account lock & not related with App passwords.

So I have reset my Atlassian account(as per Atlassian's servicedesk suggession ) using below url

https://id.atlassian.com/

So now git fetch is working fine.

If you forgot your current password you can reset password by below url

https://id.atlassian.com/login/resetpassword

Hope this help :)

Vinit Ingale
  • 381
  • 1
  • 4
  • 17
Karthikeyan
  • 748
  • 1
  • 8
  • 13
  • @sunsetjunks Just try the above solution & share the result. your feedback might help others. – Karthikeyan Mar 28 '17 at 15:11
  • What do you mean with reset? Just change the password? As Vladn already mentioned the first pull works but after that the error occure again – Moritz Mar 28 '17 at 15:53
  • @morritza Yes, I have changed the password. Sorry for the confusion!. But for me everything works fine after changing the Atlassian password. Might be others have stored the git password somewhere(global config, key chain, etc). So better to revoke old app password & try with new app password. – Karthikeyan Mar 29 '17 at 03:22
  • Now it works! :) I had to remove all app passwords and set a new user-account password. – Moritz Mar 29 '17 at 07:34
  • i think it was a temporary issue related to bitbucket itself because i did nothing and the problem was resolved by it self – Mohamed23gharbi Mar 30 '17 at 19:47
  • Worked for me. Same issue – Liquid Core Jul 26 '17 at 16:13
  • This isn't resolved and happens every day to me. Only works when I change password. But that means I have to change my password every day. Very frustrating problem. – dbp Aug 17 '17 at 15:06
  • Thanks a lot. You saved my day – Nemesis Oct 03 '17 at 16:06
23

Atlassian have just released a fix:

Hi there,

We just deployed the fix for the root issue causing this bug. If you could please retry your actions, and let us know if you run in to any further issues.

We recommend that, you log out of Bitbucket Cloud and login once again. Then please retry again.

We apologize for any delays, or outages this issue may have caused you, and your teams. Please feel free to let us know if you have any questions.

Thank you, Pravin

Update 2017-03-30:

Hi Everyone,

For the past few days some users may have experienced 503 or 403 errors related to authentication issues when using Git and Mercurial over HTTPS on Bitbucket Cloud.

We have just deployed a fix to the platform for this issue. If you could please navigate to "id.atlassian.com" in your browser, and make sure you log out of any active sessions.

If you could then attempt to login to id.atlassian.com with your email, and password - please make sure to NOT use the Google login form, and instead use the basic email/password fields. You may be asked to go through a captcha screen, or even reset your password if necessary.

Once you get logged in properly to id.atlassian.com, if you could please try your GIT/Mercurial operations again, and let us know if you are able to successfully authenticate.

Please let us know if you encounter any issues, or have any questions.

We would again like to thank you for your patience, and apologize for any downtime these issues may have caused you or your team.

Thank you, The Bitbucket Cloud Team

yoitsro
  • 293
  • 2
  • 7
8

It seems that in my case the problem is OAuth authentication. If I switch to Basic authentication, everything works fine.

For SourceTree, in Tools - Options - Authentication, delete the BitBucket account and then click Add to add again the credentials but with one minor change: In Authentication combobox select Basic. Enter your bitbucket username in Username field and press refresh password. You'll be prompted to enter your account's password but if till now you used Google account to login, set a new password here https://id.atlassian.com/manage/change-password

Now trying to find out what's wrong with OAuth.

Update

Another fix that seemed to work was deleting the passwd file from C:\Users\[your-user]\AppData\Local\Atlassian\SourceTree. Now in SourceTree do a git fetch/pull/push and you'll be prompted to login. Enter your credentials and everything should work fine now.

VladN
  • 729
  • 1
  • 10
  • 29
8

Atlassian related. I went to bitbucket, logged out, logged back in and git started working. Did not need to change my password. Took less than a minute.

2

If you have Bitbucket open in your browser, sign out. After that, i was able to clone the repo i wanted with Sourcetree.

passatgt
  • 4,234
  • 4
  • 40
  • 54
2

Just re-enter your current password it will work fine.

Settings->Accounts->Edit

just login to your Atlassian account it must be resolved.

daniele3004
  • 13,072
  • 12
  • 67
  • 75
Sagar
  • 21
  • 2
1

I changed the password and it works fine.. :)

Mesmerize86
  • 673
  • 1
  • 6
  • 15
  • 2
    In my case works only for one action. Meaning I change pass, do a pull but after if i try a push i get 403 again – VladN Mar 27 '17 at 14:07
1

Delete the "passwd" file from,

C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree.

Then restart the SourceTree. Then fetch from the required repo. SourceTree will prompt a popup to enter the password of the repo. This worked for me.

Thilina Koggalage
  • 1,044
  • 8
  • 16
0

I've just changed the bitbucket password and it worked like a charm!

0

This issue can be occurred while using multiple bitbucket accounts. For this case you can just go to "Repository settings" -> "Remotes" and specify your login in the remote path like this https://yourlogin@bitbucket.org/your-project/your-repo.git

Igor Leonovich
  • 458
  • 4
  • 13
0

The following helped me:

"For SourceTree, in Tools - Options - Authentication, delete the BitBucket account and then click Add to add again".

0

If you are using SourceTree and using oauth, i would suggest you go Tools > Options > Authentication and delete the saved passwords and your bitbucket account then add them back again. This worked for me. It will go off and refresh your token and add them back again.

Mike Hughes
  • 77
  • 2
  • 9
0

Sourcetree Mac Developer stated in the link below that it is now fixed in 2.7.4 release, please update your Sourcetree in your Mac to this version.

https://community.atlassian.com/t5/Sourcetree-questions/How-to-solve-quot-Too-many-invalid-password-attempts-quot-error/qaq-p/609886#M21780

Egemen Hamutçu
  • 1,602
  • 3
  • 22
  • 34
0

HTTP could get quite buggy with bitbucket for some reason, I'd suggest you set up an SSH key with the following steps:

Set up SSH on macOS

Step 1. Set up your default identity

  1. From the terminal, enter ssh-keygen at the command line. The command prompts you for a file to save the key in:
$ ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/emmap1/.ssh/id_rsa):
  1. Press the Enter or Return key to accept the default location.

  2. Enter and re-enter a passphrase when prompted.

  3. List the contents of ~/.ssh to view the key files.

$ ls ~/.ssh
id_rsa  id_rsa.pub 

The command displays two files, one for the public key (for example id_rsa.pub) and one for the private key (for example, id_rsa).

Step 2. Add the key to the ssh-agent

If you don't want to type your password each time you use the key, you'll need to add it to the ssh-agent.

  1. To start the agent, run the following:
$ eval `ssh-agent` 
Agent pid 9700      
  1. Enter ssh-add followed by the path to the private key file:

$ ssh-add -K ~/.ssh/<private_key_file>

  1. So that your computer remembers your password each time it restarts, open (or create) the ~/.ssh/config file and add these lines to the file:
Host *
UseKeychain yes

Step 3. Add the public key to your Account settings

  1. From Bitbucket, choose Personal settings from your avatar in the lower left.

  2. Click SSH keys. If you've already added keys, you'll see them on this page.

  3. In your terminal window, copy the contents of your public key file. If you renamed the key, replace id_rsa.pub with the public key file name.

The following command copies the output to the clipboard:

$ pbcopy < ~/.ssh/id_rsa.pub      
  1. Select and copy the key output in the clipboard. If you have problems with copy and paste, you can open the file directly with Notepad. Select the contents of the file (just avoid selecting the end-of-file characters).

  2. From Bitbucket, click Add key.

  3. Enter a Label for your new key, for example, Default public key.

  4. Paste the copied public key into the SSH Key field. You may see an email address on the last line when you paste. It doesn't matter whether or not you include the email address in the Key.

  5. Click Save. Bitbucket sends you an email to confirm the addition of the key.

  6. Return to the terminal window and verify your configuration and username by entering the following command:

$ ssh -T git@bitbucket.org     

The command message tells you which of your Bitbucket accounts can log in with that key.

    conq: logged in as emmap1.
    You can use git or hg to connect to Bitbucket. Shell access is disabled.

If you get an error message with Permission denied (publickey), check the Troubleshoot SSH issues page for help.

Reference link: https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/

ViajanDee
  • 654
  • 4
  • 15
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/30908284) – Simas Joneliunas Jan 30 '22 at 04:54
  • Cheers @SimasJoneliunas, you're absolutely right. I will invest more time into providing a complete answer on SO and reference the docs link. Thanks for encouraging users to provide better more informative answers. – ViajanDee Jan 31 '22 at 01:22