After migrating to a new MBP
Asked by murraycollingwood:

After migrating to a new MBP it took a while but I finally had my commits and pulls working.

Then I was prompted to update my macos, it's still 10.13.4 but an update none the less. So I get back to programming, now I want to commit my change but Sourcetree is throwing a security error.

I have read through the error message - this is exactly what I was getting before, but somehow I had done something to make it work. Now it isn't. I tried moving the ssh key to the group definition rather than my login, however that isn't working either.

Reading through the message - there is no clear indication exactly what username / group this is trying to authenticate with. If anything I would suggest it was trying to use git@bitbucket.org, clearly not my unique username. Perhaps you could improve the error message to tell me what is actually the problem. The message 'Permission denied (publickey)' says there is a permissions problem, but it doesn't say whether the publickey is the problem or not. Is the problem in the key, and if so with which account is it a problem. Similarly, I shouldn't assume the publickey is the problem because it doesn't actually say that. So, does my account have access to the particular repository, is that the permission denied problem I'm getting - I really don't know.

I'm instructed to check I have the correct access rights and the repository exists - well it worked about 30 minutes ago so I'm guessing I can skip over that.

Next I'm told to check the access rights and the repository exists - yeah - just did that.

Next I'm told to check the access rights and the repository exists - yeah - just did that.

Next I'm told to check the access rights and the repository exists - yeah - just did that.

Do you have any other (different) suggestions?

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags origin refs/heads/ui-upgrade:refs/heads/ui-upgrade

Pushing to git@bitbucket.org:sobscomau/sobs.git

git@bitbucket.org: Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

Pushing to git@bitbucket.org:sobscomau/sobs.git

git@bitbucket.org: Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

Completed with errors, see abovePushing to git@bitbucket.org:sobscomau/sobs.git

git@bitbucket.org: Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

Pushing to git@bitbucket.org:sobscomau/sobs.git

git@bitbucket.org: Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

Completed with errors, see above


Answers:
author: Ana Retamal
body: Hi Murray! For what I saw, the repo you're trying to access belongs to a Team account (git@bitbucket.org:**sobscomau**/sobs.git). Team accounts do not have credentials, instead every user uses their own individual Bitbucket account to access the Team. Can you confirm you've added your credentials to Sourcetree following the steps at [Connect your Bitbucket account](https://confluence.atlassian.com/get-started-with-sourcetree/connect-your-bitbucket-or-github-account-847359096.html)?

After that, please try to push to that repo again and let us know how it goes!

Best regards,

Ana

comments: author: murraycollingwood
body: Hi Ana

We found the problem. After migrating to the new MBP somehow the install settings for Bitbucket had been changed. The correct settings (as now configured):

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/21410iFF221F34443C4306/image-size/large?v=v2&px=999 "image.png")

Before we corrected this the Host Root URL had a value of [https://www.bitbucket.org](https://www.bitbucket.org?)

I hadn't added that value. My process was (afaicr):

a) Install the latest Sourcetree

b) Login into my Bitbucket account

c) Open the local repository

Not sure if that helps you in applying a fix to Sourcetree, but perhaps somewhere in the setup code there is a default 'www' that shouldn't be there?

Anyways, I'm all working and that's good.

Cheers

Murray


Tags: mac