Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

App password SourceTree

Luciano Allegro March 1, 2022

Hi I followed all steps to create an app password from the personal settings page. However when trying to load that password into sourcetree I get an authentication failed "You don't have permissions to acces URL 'https://api.bitbucket.org/2.0/user'. The request returned with the status code 'Unauthorized'

It seems sourcetree is not able to connect the endpoint to check if the app password exists. I tried already updating to the latest stable release but without success.

Does anyone have the same issue?

5 answers

1 vote
yeisson72 March 1, 2022

Mr Allegro,

I have the same problem, today I tried to pull and push new commits but the system all the time said me:

Command: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks ls-remote https://yeissonh@bitbucket.org/**************
Output:
Error: remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
remote: App passwords are recommended for most use cases and can be created in your Personal settings:
remote: https://bitbucket.org/account/settings/app-passwords/
fatal: Authentication failed for 'https://bitbucket.org/*********

I try to delete the files and recreate the repository but nothing worked. 

David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 1, 2022

@yeisson72 I don't believe your issue is the same as Allegro's, as they would be receiving the same error message as you if that was the case, and it does not appear that they are.

However, I'm curious, are you using Sourcetree on Windows or Mac? Also, did you go to your Sourcetree settings, navigate to the Bitbucket Cloud account that Sourcetree uses, and change the password to your new app password?

yeisson72 March 2, 2022

Hi!

I'm using Sourcetree on Windows. And yes I changed the password for a new. but it didn't work. 

Like Justin Raymond Ramos likes this
David Shapira
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 2, 2022

I have the exact same error any help is really welcome

yeisson72 March 2, 2022

Hi!

I resolved in this form:

I created SSH Key, I used this article:

Set up an SSH key | Bitbucket Cloud | Atlassian Support

And clone one more time

regards,

David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2022

yes @yeisson72 SSH should work as expected given this change had no impact on SSH authentication. However, some of our users prefer to use HTTPS authentication for various reasons.

You stated that you changed your password for a new one. Can you please confirm that you changed this "new password" to an app password which is different from an account password. Details: https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/

 

Some Windows Sourcetree users have noted that even after updating their connected account's password to an app password in Sourcetree they still get the same error message. This could be related to various things but it could be the case that Sourcetree is still using some older configs that are still using their old account password to authenticate with Bitbucket Cloud when pushing/pulling/etc. Some of our users have noted that they fixed the issue by doing the following:

Note, the following steps are for Sourcetree for Windows.

  1. Update to the latest version of Sourcetree for Windows
  2. After updating (or confirming you are already on the most updated version of Sourcetree), on the tool bar click "Tools" >> click "Options"
  3. On the "Options" window click the "Authentication" tab
  4. Remove your Bitbucket Cloud account credentials
  5. Walkthrough the steps again to add/connect your Bitbucket Cloud account.
    1. Ensure your username is correct
    2. Ensure you are using an app password and that it is also correct (ensure there are no copy and paste errors when copying the app password over to Sourcetree).

Please let me know if any of these suggestions help.

If, after you have tried all of these suggestions then I would suggest you reinstall Sourcetree by doing the following:

Please, that the following reinstall instructions are for Windows Sourcetree.

**IMPORTANT** Please note that reinstalling Sourcetree will remove all preferences and settings you may have. So, please backup the referenced files/directories below before proceeding.

  • Backup/save ALL Sourcetree & Sourcetree-Settings folder/files in C:\Users\<UserName>\AppData\Local
  • Backup/save ALL Sourcetree Files/Folders in C:\Users\<UserName>\AppData\Local\Atlassian

After backing up those directories/files, you can proceed to uninstall and then reinstall Sourectree

  1. Uninstall Sourcetree (if it shows on the App&Features list)
  2. Only delete the following folders/files after you have backed them up. Delete the directories below before proceeding to the next step
    • Navigate to C:\Users\<UserName>\AppData\Local and delete Sourcetree & Sourcetree-Settings folders
    • Navigate to C:\Users\<UserName>\AppData\Local\Atlassian and delete all Sourcetree Files/Folders.
  3. Download SourceTree and install it. 
Like David Shapira likes this
David Shapira
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 3, 2022

Reinstalling Souretree worked for me

Like David Dansby likes this
David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 2022

@David Shapira that is great to know. Thank you for patience in my assistance on resolving this issue. Also, thank you for taking the time to follow all the steps up through reinstalling in order to get a resolution. I personally know how annoying it is to reinstall software to get a fix, so I really appreciate your taking the time to do that. 

Please let us know if you have any other issues related to this.

Also, to clarify just in case someone else comes to this page, from my knowledge (I don't work on Sourcetree just Bitbucket Cloud), this issue does not appear to be caused by app passwords. It appears to be caused by some issue with the Git credential manager that Windows uses, and in turn what Sourcetree uses. I guess it's cached the old credentials somewhere and is still using them, even though you have correctly updated to an app password and Sourcetree shows your Authentication is good after updating to app password.

hogtownrocketsled March 4, 2022

Reinstalling worked for me
THANK YOU 

Like David Dansby likes this
David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 2022

@hogtownrocketsled great to hear. As I told David, thank you for your patience in dealing with this weird Sourcetree for Windows issue and taking the time to walk through the steps (including reinstalling) to get it resolved.

Paoloimg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 23, 2022

I've followed steps 1 to 5 as mentioned by @David Dansby with no success on Windows. As soon as the basic authentication has been deprecated my pushes (i.e.: every time I push my commits) started to require an authentication by showing me a window requesting userid and password. No matter what I type in the window, it always resulted in authentication error.
I eventually reinstalled Sourcetree, then it finally started working. This seems to be the only working option.
I've noticed that, with the new Sourcetree installation, the bitbucket Account added by the installation wizard in the Tools/Options/Authentication panel is now using OAuth instead of Basic Authentication. Changing back to Basic Authentication and providing the App Password configured online under my Personal Settings, is now perfectly working.

yeisson72 March 23, 2022

@David Dansby 

Thanks

I deleted all and installed one more time. Finally all worked. 

Regards, 

0 votes
Pawel Cioch March 25, 2022

Also update your credential manager, it integrates better with Atlassian 
https://github.com/GitCredentialManager/git-credential-manager/releases

0 votes
Jay Wolberg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 2, 2022

I also can not commit from Sourcetree to bitbucket after the App password change.

I have created the App password on Bitbucket.


On sourcetree repo settings I am using the same path as before

https://jmwolberg@bitbucket.org/jmwolberg/XXXXXXXXXX.git

I deleted all previous authentication and only have the one one for an App Password:


SourceTree Tool Options Authentication Accounts:   jmwolberg@bitbucket.org
Host: bitbucket.org
Default account: Yes

Hosting Service: Bitbucket
Auth: Basic
Username:  jmwolberg
I have refreshed with my App Password 
I have a green checked Authentication OK!

When I go to commit, error is:

fatal: Authentication failed for 'https://jmwolberg@bitbucket.org/jmwolberg/xxxxxxx.git/'
remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
remote: App passwords are recommended for most use cases and can be created in your Personal settings:
remote: https://bitbucket.org/account/settings/app-passwords/
 

0 votes
Luciano Allegro March 2, 2022

@David Dansby  thanks for your reply. I tried several times with all perms and reduced ones. However it seems more of a sourcetree problem as it seems it cannot connect to the endpoint to validate any type of basic user account. I am using sourcetree for windows without any special config or network arrangement that could block these requests.

David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2022

@Luciano Allegro just so I verify. You are not receiving the same error as @yeisson72 is, right? Even when you update your app password you are not seeing Sourcetree telling you Authentication is ok but then you still receive the error messaging saying you can't use an account password and to check our community post like the below?

"Error: remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
remote: App passwords are recommended for most use cases and can be created in your Personal settings:"

If that is the case then there could be a host of reasons why this is could be happening. If you have not tried it yet I would try the following:

  1. Update to the latest version of Sourcetree
  2. After updating (or confirming you are already on the most updated version of Sourcetree), on the tool bar click "Tools" >> click "Options"
  3. On the "Options" window click the "Authentication" tab
  4. Remove your Bitbucket Cloud account credentials
  5. Walkthrough the steps again to add/connect your Bitbucket Cloud account.
    1. Ensure your username is correct
    2. Ensure you are using an app password and that it is also correct too.

The fact that you state that you see the error  "You don't have permissions to access URL 'https://api.bitbucket.org/2.0/user" suggests that the app password you updated to in Sourcetree was wrong so it could also be related to a copy and paste error or something similar when you were copying the new app password over to Sourcetree.

 

Please let me know if any of these suggestions help.

If, after you have tried all of these suggestions then I would suggest you reinstall Sourcetree by doing the following:

Please, that the following reinstall instructions are for Windows Sourcetree.

**IMPORTANT** Please note that reinstalling Sourcetree will remove all preferences and settings you may have. So, please backup the referenced files/directories below before proceeding.

  • Backup/save ALL Sourcetree & Sourcetree-Settings folder/files in C:\Users\<UserName>\AppData\Local
  • Backup/save ALL Sourcetree Files/Folders in C:\Users\<UserName>\AppData\Local\Atlassian

After backing up those directories/files, you can proceed to uninstall and then reinstall Sourectree

  1. Uninstall Sourcetree (if it shows on the App&Features list)
  2. Only delete the following folders/files after you have backed them up. Delete the directories below before proceeding to the next step
    • Navigate to C:\Users\<UserName>\AppData\Local and delete Sourcetree & Sourcetree-Settings folders
    • Navigate to C:\Users\<UserName>\AppData\Local\Atlassian and delete all Sourcetree Files/Folders.
  3. Download SourceTree and install it. 
Like Jay Wolberg likes this
hogtownrocketsled March 2, 2022

I've got the same problem and have gone through all the steps above and still no joy.
Before I go deleting and reinstalling, does anyone know it that is really going to work?
thx

David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2022

@hogtownrocketsled can you please tell me what your git remotes URL state as. I forgot to mention that app app passwords don't allow email as a username and sometimes git remote URLs include the username as the email instead of your Bitbucket Cloud username.

One user with a similar issue resolved it with 


If your git remote URL is in the format:

https://[email@email_domain.com]@bitbucket.org/[workspace]/[repository].git

can you please edit to switch the email address to your Bitbucket Cloud username so the remote URL should be changed to look like:

https://[bitbucket_cloud_username]@bitbucket.org/[workspace]/[repository].git

Please sure you added your app password and Sourctree shows "Authentication: OK" for your connected Bitbucket Cloud account

David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2022

@David Shapira @yeisson72 @Luciano Allegro please see my comment above about ensuring your git remote URL uses your Bitbucket Cloud username and NOT your email that is tied to your Bitbucket Cloud account.

yeisson72 March 2, 2022

Hi

Yes, I used my username. And I use "App passwords" too.

regards, 

hogtownrocketsled March 2, 2022

On bitbucket, bitbucket profile settings, user name:     hogtownrocketsled

On sourcetree, repo, repo settings,  remotes/origin 
I have confirmed the path is as: 

https://hogtownrocketsled@bitbucket.org/hogtownrocketsled/XXXX.git
Remote Account;  Bitbucket    hogtownrocketsled 

SourceTree Tool Options Authentication Accounts:   hogtownrocketsled@bitbucket.org
Host: bitbucket.org
Default account: Yes

Hosting Service: Bitbucket
Auth: Basic
Username:  hogtownrocketsled
I have refreshed with my App Password 
I have a green checked Authentication OK 

Still no joy 
 





David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 3, 2022

@hogtownrocketsled and @yeisson72 and @Jay Wolberg given you all three are still experiencing this issue. I would advise reinstalling Sourectree according to the instructions I have stated above.

Another Sourcetree for Windows user noted to me in our community post that this was the only way they got their Sourcetree to fix the issue. Please let me know after you have reinstalled Sourcetree for Windows if the issue is resolved for you.

Like Jay Wolberg likes this
Jay Wolberg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 3, 2022

EDIT: Now working after trying again and deleting all Atlassian & SourceTree folder files.

 

===

Uninstalled v3.4.5

Delete Atlassian & SourceTree folder files.

reinstalled (v3.4.7).

Then recreated new app pw and added new app pw.

User and app pw authenticates successfully. 

Push successfull

Luciano Allegro March 3, 2022

Hi @David Dansby I appreciate your dedication to help. I did check on all your steps and I was using my username in the URL of the bitbucket cloud repository. I couldn't find any workarround to the issue other than using another Git tool by now. I still have to re-install sourcetree which I will hopefully do as soon as I have some free time.

David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 3, 2022

@Jay Wolberg that is good to know. 

@Luciano Allegro I've been told that credential managers in windows have been big problems for Sourcetree in the past. I don't know if it's specifically related, but I imagine it is so. Unfortunately, right now, it appears the only way to resolve this issue is with a full reinstall using the steps I have noted in my previous comments above. As Jay noted above, that was the only thing that worked for him. Please let me know if after reinstalling using the steps above your issue has been resolved. 

For context, this issue is not caused by the removal of account passwords for app passwords in Bitbucket Cloud, but is a Sourcetree for Windows and/or Windows Git Credential Manager issue.

However, I want to personally apologize for this issue. Although I don't work on Sourcetree, I know how annoying these types of issues are when the application says one thing (i.e. Authentication: OK) but then acts differently (i.e. can't push/pull and the error says you are still using an account password). This is why I've been trying hard to get a resolution for you all and our other Sourcetree for Windows users experiencing this, especially because so many Sourcetree users are valued Bitbucket Cloud (which I do work on :D) users.

I hope this works for you @Luciano Allegro , let me know.

Best,

David

Like Jay Wolberg likes this
0 votes
David Dansby
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 1, 2022

@Luciano Allegro what perm scopes did you select for the app password you created?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events