Stash Git error "fatal: remote error: CAPTCHA required"

106.9k views Asked by At

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

There are 20 answers

0
Nathan Fig On BEST ANSWER

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

3
chjortlund On

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.

0
Scala Enthusiast On

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
Bayram Binbir On

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.
2
Siri Elchuri On

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

0
jithin cheruthala On

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

6
Sneaky Polar Bear On

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.

1
Rich On

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.

0
neoscribe On

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
mu88 On

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).

1
Ozan Aksoy On

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.

0
brkeyal On

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
2
Victor Oliveira On

This happened to me. I tried to remove sourcetree password file but didn't worked. I logout and login on bitbucket but didn't worked too. The thing that worked was to go to Panel Control on Windows and Credential Manager, I changed/removed all references to my git repo.

0
javaJavaJava On

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.
0
Hüseyin On

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!
0
Joey Steve On

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
Raghvendra Pacholi On

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.
0
Umesh Vishnu Patil On

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
Yogesh Kolhe On

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

Logout and login in bitbucket

0
Prakash Dahal On

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.