I have SSH enabled on our Bitbucket Server, but have been struggling, for over a year with not being able to create a Remote Account, in SourceTree, on my Mac, for it. I can't remember when it broke in Sourcetree, but I've had several Macs over that time, and the issue is with Sourcetree.
I have created SSH keys, and loaded the Public key into my Bitbucket Server User A/C. I know they work as the PC Sourcetree app has no problem creating a Remote Account for it.
Whereas, to achieve the same, with the macOS Sourcetree app, I go to Preferences and then Accounts. From there I click 'Add...' and a dialog to add a new remote account appears. I change the host from Bitbucket to Bitbucket Server. Next to Host type, I provide the http(s) URL of our Bitbucket Server . The Auth Type cannot be changed from Basic. In the Username field I add my UserID. The Protocol is kept as SSH, and for the SSH Key it has found and selected my own id_rsa.pub, that I have also loaded into Keychain Access previously (via 'ssh
-add -K ~/.
ssh
/id_rsa').
When I click Save, it comes up with an Authentication dialog, saying Login required for the Bitbucket Server, with my username pre-populated and uneditable, and a password field. Before I can type in my Password, another modal dialog pops up in front of it, saying:
"Login error
Login failed for your Bitbucket server account.
The remote service said: 'The operation couldn't be completed. (SDNetDomain error 7.)'"
All you can do is accept the error. It has obviously not been able to connect and hence the repositories available to me are not listed. You can then go back to enter your password, in the previous dialog, but this does not achieve anything. The Remote Account is still defined within SourceTree, but if you ask it to refresh itself, then you get the same error again!
What I have just found out, is that if you edit it, change the Protocol back to HTTPS and save it, it will complete by attempting to connect, and simply brings up the Username/Password Login dialog. There is no accompanying error, so you can enter your password, and if it is correct, it will list your repositories and add an Application Password, into KeyChain Access, for the Bitbucket Server host and your UserID (i.e., called host Access Key for UserID and it will be found under Passwords in the login category). This does assume that your Bitbucket Server has HTTP(S) SCM hosting enabled as well. this will mean though that if you clone any repositories, it will be done via the http(s) Source URL!
Though the important part is that it has allowed you to create an Application Password in KeyChain Access. This is what I believe it was also trying to do, when the Protocol was SSH, but because it was also trying to access the SSH Keys at the same time, or prematurely, it would get the error.
So, finally, if you edit the Remote Account again, and change the Protocol back to SSH, it will now start to work, will list your repositories and allow you to clone them via the SSH Source URL.
It seems to be working for me, and I hope it helps others with the same problem.
Looks like I spoke too soon. Another day, and it's playing up again, and I can't get it working no matter what I try :-(
Which included:
I also cleared everything down, and tried both the Beta and Latest builds from:
https://bitbucket.org/atlassianlabs/sourcetree-betas/downloads/
Unfortunately, they don't work either.
Hopefully your fix comes soon, as it's been hanging around as an issue for a couple of years now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for confirming that it is an issue.
What is the Jira Issue number for this bug?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In order to create a remote repository from Sourcetree, we need the https password to execute REST APIs. Hence, it isn't possible to do so with ssh since there is no password available to authenticate the user on Bitbucket server with a REST call.
This works with https. However, we are working to get this fixed in an upcoming release. Thanks for your patience.
Regards,
Manjunath
Sourcetree Mac Developer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.