SourceTree & SourceTree-Beta macOS Fail Authentication with Local BitBucket Server

Andrew Seago February 6, 2018

UPDATE: Tower 2.6.4 works without issue. 

System: macOS 10.13.4b1

SourceTree Versions Affected: 2.7.1 beta latest build 2018-02-06 & 2.7

BitBucket Server: 5.7.1

ISSUE: When setting up the Bitbucket AD linked account in SourceTree it is unable to authenticate on both ssh and https. 

http error window:

"The remote service said: 'The operation couldn’t be completed. (SDNetDomain error 7.)'"

http error log: 

2018-02-06 19:59:30 +0000 () [AUTH] Removing the token available in the client before re-authentication
2018-02-06 20:00:26 +0000 () [AUTH] signing out of Bitbucket Server account

 

ssh error window: 

"The remote service said: 'The operation couldn’t be completed. (SDNetDomain error 7.)'"

 

ssh error log: 

2018-02-06 19:59:30 +0000 () [AUTH] Removing the token available in the client before re-authentication
2018-02-06 20:00:26 +0000 () [AUTH] signing out of Bitbucket Server account

 

Attempted Fixes: 

Delete all SourceTree files from ~/Library/ 

Delete Account and Recreate

Try Beta SourceTree Build

1 answer

0 votes
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

From the logs you've pasted here, it looks like you are trying to use Bitbucket Server account with OAuth. Can you confirm that? 

Currently, we do not support OAuth for Bitbucket Server accounts. Please try to add the account in Preferences with basic auth and that should work. If you encounter an issue with that, report back here with details. 

Andrew Seago February 7, 2018

This is while using basic AUTH selected. And I have purged all settings and created it again. I agree it seems to be attempting OAuth. But its not in a setting I was able to choose. 

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

Can you check if the keychain has an item with the title <yourbbserver> Access key for <yourusername> and there is a file <yourusername>@STAuth-<yourbbserver> at ~/Library/Application Support/SourceTree/ ?

If the account was successfully added, these two items must be found. 

If not, remove the account in Preference and add it again. (do not edit the existing account). If the keychain item isn't found this time, restart the mac once and try again. This happens when there is a permission issue with keychain allowing access to Sourcetree.

Andrew Seago February 7, 2018

SourceTree creates application password entries in my local keychain: <yourbbserver> Access Key for <yourusername> 

 SourceTree does prompt for keychain access and is allowed access. And since it is writing to the keychain it has access. The same log entries however appear. This time prior to switching from Bitbucket to Bitbucket server I selected Basic auth as that option is grayed out when you select Bitbucket server. This did not make any difference. 

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

Alright! This is a little weird. 

An access prompt for that particular keychain item must come up ideally. Just because Sourcetree wrote it doesn't mean it has access to it. Just to test, under access control of the keychain item, can you set "Allow all applications to access this item" and see if it helps?

Andrew Seago February 7, 2018

Key Access does prompt for allowing SourceTree access to the keychain and the entry does allow sourcetree access. Seen in picture belowScreen Shot 2018-02-07 at 2.19.05 PM.png

Also, Remote Repositories do populate however when I go to clone them is when I receive the error below.Screen Shot 2018-02-07 at 2.21.34 PM.png

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

Other than what you've already provided above, do you have any other logs when this happens?

If not, you can enable debug mode logging by running below command. 

defaults write com.TorusKnot.SourceTreeNotMAS "LogLevel" 5

Remember to restart the app after enabling debug logging. 

Also, can you specify if you are using https or ssh?

 

Thanks!

Andrew Seago February 9, 2018

HTTPS and I've ran the command and I see it in the plist but I'm not seeing any additional logging. Should this also be loging in the ~/Library/Logs/SourceTree directory? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events