42

Attempting to pull from my Stash project, using the following commands:

$ git remote add origin https://[email protected]/scm/~username/project.git
$ git pull origin develop

I'm prompted for my password, which I enter and then get the following error:

Your Stash account has been marked as requiring a CAPTCHA to be solved before you may login again. This is typically caused by too many attempts to login with an incorrect password. The required CAPTCHA prevents your SCM client from accessing Stash until it is solved, even if you enter your password correctly. If you are currently logged in to Stash via a browser you may need to logout and then log back in in order to clear the CAPTCHA.

Logging out and back in again does not help. How do I fix this?

20 Answers 20

28

You might have a session to BitBucket open in a browser, that gives the impression that everything is fine. Simply logout and in again, when logging in you need to solve a CAPTCHA, after that you are good to go.

3
  • 6
    doesnt work for me
    – GenDemo
    Commented Mar 20, 2023 at 2:47
  • No captcha for me after logging out and in again.
    – C4d
    Commented Feb 6 at 9:06
  • It's not working for bitbucket enterprise. Commented Mar 27 at 0:31
19

Another common issue with captcha warning seems to relate with password changes. Once your password is changed in the system you are authenticated with, both sourcetree and eclipse plug-in might have password conflict with the already logged in session on bitbucket, causing CAPTCHA authentication to activate.

Solution: Enter to your bitbucket session, logout and login again. If issue persist, then you might want to check the URL, since captcha activation would direct you to another direction and your user account with malfunctioning URL will raise authentication failures again and again.

1
  • 1
    I am having similar issue after updating the password. But even if I re-login with GITHUB(No BitBucket) account, I am facing same issue. is there anything I am missing? Commented Dec 15, 2020 at 16:46
18

This happened to me. I tried to remove sourcetree password file but it didn't work. I logged out and logged in on bitbucket but it didn't work either. The thing that worked was to go to Control Panel on Windows and Credential Manager to change/remove all references to my git repo.

2
  • I have this same issue, but not seeing any git references in my credential manager. I only saw a few microsoft office references...
    – CCNA
    Commented Jan 17, 2020 at 14:53
  • Thank you. I don't want to remove the references because mine is a company laptop. So I just changed updated the password to Bit Bucket. Actually I've done that before, but just forget totally. Thanks for reminding me. Commented Apr 14, 2020 at 15:35
15

What worked for me was to go into: C:\Users\UserName\AppData\Local\Atlassian\SourceTree and delete the passwd file. Sourcetree was closed and I was logged out of bitbucket. I then logged back into bitbucket and solved the captcha. Then when I launched sourcetree and did a fetch I entered my password and all was well.

6
  • Thanks, the only solution that works for me every time I change password
    – never
    Commented Oct 19, 2017 at 6:41
  • Where can I find this file on Mac? Commented Mar 9, 2018 at 13:31
  • Not a mac user but apple.stackexchange.com/questions/28928/… I would look in (~/Library/Application Support) Let me know if this works and I will add it to the answer Commented Mar 9, 2018 at 16:33
  • where is the passwd file?
    – mobibob
    Commented Jun 19, 2019 at 21:05
  • It should be in that folder location, unless you have never entered the password dialogue for sourcetree (ie you just installed and have not started it up yet) Commented Jun 20, 2019 at 5:45
10

In case of stash on macOS, this has worked for me:

  1. Close SourceTree
  2. Open Keychain Access
  3. Search for "stash", and remove any entries
  4. Go to stash website, log-out and login again
  5. Open SourceTree and enter your password
0
8

I was facing the same issue after changing my Windows domain password. The following steps solved it for me:

  • Close all clients (e. g. terminals, IDEs, browsers)
  • Open Windows Credential Manager (enter "Credential Manager" into Windows search) and delete all entries under Windows Credentials related to the BitBucket instance
  • Open browser instance without login information (e. g. Chrome incognito or Firefox private window)
  • Navigate to https://<<your BitBucket>>/login?auth_fallback, login and solve the CAPTCHA

Now when executing git pull origin, the credential manager popped up, I could enter my new/current password and voila 👍🏻

As a user of JetBrains Rider, I had to clear all stored passwords within Rider (see here).

0
3

In case of Windows, this worked for me:

  1. Go to Windows search
  2. Type and Open Credential Manager
  3. Then Windows Credential Manager
  4. Delete your bitbucket/github account
  5. Run command you want(pull, push etc.)
  6. It asks to you your credentials for bucket or github account
  7. Enter them properly
  8. That's all!
3

In my case, our organisation using a Bitbucket Server, and an SSO credentials. I logged out to the website, and instead of using the SSO button to login, I had to put my credentials in order to get the CAPTCHA needed to solve this issue.

1
  • 1
    I don't see why this answer got downvoted. This is one of the 50 things you will need to try. And if you are in an organization that uses SSO, and also forces you to update your password regularly, this answer is the one you need.
    – rrreee
    Commented Jun 14, 2023 at 14:44
3

My problem was a malformed URL: it should be https://[email protected]/scm/~username/project.git instead of stash@stash.

2

Go to your Windows >> type credential manager >> windows credential >> update password under bitbucket link

Logout and login in bitbucket

0
1

For SourceTree when getting this error I had to do the following:

  1. In a browser Go to Stash/BitBucket and logout and login and validate using your new pwd and captcha. Once validated they would remove the captcha validation requirement on your account.
  2. If I come back to SourceTree and do a pull or fetch I still get the validation failed message since it tries to use same old stored password. In order to avoid using the old password try opening a Terminal from SourceTree itself and then do git fetch. It should ask for your new password and you can provide the new pwd which then gets stored.
1

All of the solution didn't work. Finally, I found the answer!
In my devops workplace, there is a self server and I can clean bitbucket CAPTCHA.

PS:

  • The url of my bitbucket is: https://git_adrress/bitbucket/dashboard
  • The url of my devops workplace is: https://git_adrress/#/console
0

I was doing this log-out and log in again but it had no effect. I am on a corporate land with SSO (Single Sign-on) to log in to Stash. Then, I logged out and then did a hard refresh in my browser (Shift-refresh in FireFox). This brought up the login-screen with the captcha.

Once that was logged-in I went into SourceTree and deleted my password from Tools > Options > Authentication.

When I went back to do the pull request again it asked me in a pop-up for my password and worked well from there.

0

In case you are using sourcetree, Go to Tools-->Options--> Authentication and delete Git saved passwords. This solved my issue

0

Sometimes SourceTree in Windows gets hosed when you change your password and causes you to get locked out of your "Stash" Bitbucket Server instance pending login with CAPTCHA.

Here are the steps that worked for me...

  1. Close SourceTree and ALL Visual Studio instances
  2. Search for "Credentials Manager" in Windows then remove all credentials related to git
  3. Remove the SourceTree passwd file found at C:\Users%USERNAME%\AppData\Local\Atlassian\SourceTree
  4. Wait 10 minutes then log in and do the CAPTCHA dance: https://(mybitbucketserver)/login?nextUrl=%2Fdashboard
  5. If CAPTCHA keeps saying you entered the wrong password after a few tries, go to step 4.
  6. Once logged in, open SourceTree and try to pull one of your repos. This should prompt you for your credentials.
  7. If it fails again, go to Tools/Options/Updates and Check For Updates
  8. If SourceTree is up-to-date, go to Tools/Options/Git and update your Embedded Git or System Git (whichever you are using)
  9. Go to step 1
0

If you are facing the issue with Bitbucket on macOS:

  • Close SourceTree
  • Open Keychain Access
  • Search for "bitbucket", and remove any entries
  • Go to stash website, log-out and login again
  • OR Open terminal and apply git pull command
  • Then enter your credentials.
0

For those who is having SSO , you cannot get the Login page

So, to get the Login page try below address and login with capche

https://your.bitbucketserveraddress.com/stash/login?auth_fallback

2
  • 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
    – Mihai
    Commented Nov 16, 2022 at 8:07
  • I tried but It's redirected a 404 page. Commented Mar 26 at 1:44
0

Open the chrome in incognito mode and go to this URL:

https://<<Your BitBucket Domain>>/login?auth_fallback

Be sure you typed your correct bitbucket address in the above link.

Fill the credentials and it will ask to solve the captcha. Solve it and the issue is solved.

0

if bitbucket is having SSO and once you change your sso credentials then it may happen. It's because of stale git/bitbucket credentials in windows credentials manager.

Captcha confirmation is required only after 100 unsuccessful login attempts. Please check for any other saved passwords that is causing multiple unsuccessful login attempts.

Solution:

  1. Update git credentials in windows credential manager. close it.
  2. Please open git/bitbucket URL in incognito mode to clear captcha on your own. Your typical URL should be like "https://git.*******.com/login?auth_fallback"

Enjoy the day!!

0

I am a Mac user and faced the same issue the steps below worked for me.

  1. Go to "Acccounts" of your sourcetree and remove the user facing the issue.
  2. Terminate sourcetree on your system and clear user credentials from Keychain access.
  3. Move to bitbucket from your browser and then logout(if already logged in) and then not proceed with SSO but login by entering your credentials and it will ask you to enter CAPTCHA to proceed ahead. perform the same and move to your bitbucket dashboard.

Note: Before performing step 4 disconnect from your client VPN as it might not allow you to connect user with OAuth. 4. Now open sourcetree, move to "Accounts" and add user again(removed in step 1) with OAuth and HTTPS preferably.

You can add user via "Basic" as well here by entering your credentials manually.

  1. Perform push and pull and have a test.

Not the answer you're looking for? Browse other questions tagged or ask your own question.