SourceTree does not save password and cannot connect to Bitbucket Server account Edited

Two questions. I'm starting with the most annoying one.

I have a repo setup in SourceTree. Whenever I'm fetching, pulling or pushing it keeps asking me for my password, even though "Store Password in Keychain" is ticked. This dialog opens twice for each operation, and its modal and lies above all other windows.

The second issue I'm having is to successfully integrate with Bitbucket Server we're running. Even though I can clone a repository in SourceTree (or from the command line), when I go to Settings -> Account -> Add... and fill out the details, it keeps prompting me for password, never satisfied. With SSH I don't really get an explanation (it just says SSH failed), but with HTTPS I get "The remote service said: 'The operation couldn’t be completed. (SDNetDomain error 7.)'" However, I can do all other remote operations successfully from SourceTree and CLI. I've also noticed that when I try this, I eventually get locked out of Bitbucket and must login with CAPTCHA. (Yes, I am supplying the correct password / same as when I log in to the web interface)

We're managing Bitbucket accounts through JIRA.




MacOSX High Sierra

SourceTree 2.7 (have happened in previous versions as well)

1 answer

Hi Oscar,

1. Can you please confirm what type of a host is this repository?

2. Can you please check if there is an entry in keychain for the password you are entering in Sourcetree's account tab? 
If not, can you remove any keychain item added by Sourcetree in the keychain previously, remove account in Preferences, restart Sourcetree (even Mac if you can as we have seen some keychain permission issues a few times) and add the account again? This time you should see the keychain item added by Sourcetree. 

If this isn't working, please file a ticket on




1. Its a Bitbucket Server running on Linux. Same as in the other issue. I'll have to wait to see 

2. I opened Keychain, searched for Sourcetree and deleted all entries. Removed my Bitbucket account from Sourcetree and restarted Sourcetree. I have also removed Sourcetree according to the knowledgeable entry. Now I instead get "The remote service said: 'An SSL error has occurred and a secure connection to the server cannot be made.'" if I'm using HTTPS URL or "Login failed for your Bitbucket Server account. The remote service said: 'Login error'" if I'm using HTTP URL the last error also appears for SSH.

Maybe Sourcetree will not allow non-HTTPS connections? (We can clone, fetch and pull correctly with HTTPS, but the server is not configured for HTTPS access in normal use (its only accessible within our network, so we never bothered with HTTPS).

I have exactly the same problem. For awhile it was connecting, however, the repository's that I downloaded via source tree and compiled in Xcode.. failed with lots of errors. Once I downloaded/cloned these vie command line .. no problem.


I'm afraid Sourcetree has become useless with Bitbucket servers

I am sorry that you are facing these issues on Sourcetree. With SSH, we are aware of the issue and will have a fix soon. Since there is no password available or requested while adding an account as SSH, we cannot pull remotes or execute REST calls. As far as https is concerned, everything should function normally with basic authentication. Can you please provide error messages and account config information? Screenshots and logs would be very helpful and you can replace some random data in screenshots if privacy is a concern. 


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

950 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you