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

Error while adding SSH key with GitHub account it says Upload Failed

Divyesh Parmar November 19, 2018

Hello everyone I'm new to using SourceTree and I need to use the stash functionality basically for my task at work ( I know it can be done with git terminal as well ) 

Whenever I set up my GitHub account and with SSH protocol and my SSH key it says 

```
Upload failed

 

There was a problem adding your new SSH key to your GitHub account. Please add this manually via their website.
```

Now I have also again configured my system's Macbook pro's SSH key to my GitHub account again but the same error appears. 

Any help/information/guidance is appreciated.

6 answers

4 votes
cilhao January 21, 2021

The problem is that you have enabled your two factor authentication and Sourcetree is not able to connect. You must go to your GitHub account and create a Personal Access Token in Developer Settings, after that you go to you Sourcetree and edit the Auth Type of your GitHub account to Basic, fill your username and paste your newly created Access Token instead of your password, this will bypass the second factor of authentication.

Sam Mojica September 13, 2021

This worked like a charm. Thank you!

Like # people like this
Bala Mithun September 18, 2022

Thanks a lot. It worked now.

Manickam THANGARAJ -AWSINDIA- October 9, 2022

thanks. works for me

3 votes
mcolboc November 19, 2019

this solution worked for me:

https://community.atlassian.com/t5/Bitbucket-questions/SourceTree-can-t-detect-SSH-Keys-installed-on-OSX-any-more/qaq-p/54904

  1. Click the Terminal button
  2. type
    ssh-add -K ~/.ssh/<git_key_name>
Som Meaden January 13, 2020

Can confirm this worked for me. New install using an old (sourcetree-generated) key.

chris warner September 3, 2020

Hello, I am having this exact error with source tree 4.07.

I have tried all the recommended fixes and I cannot use source tree to access github at all.  

I am running the latest install of Mac Catalina, and I have XCode setup to work with personal tokens from github, all access to github is managed through ssh keys per githubs recommendation as part of their security enhancements.

 

the only git client that doesn't work with github is now sourcetree.  

Again, I have tried all the recommended fixes and I am still stuck with this error

2 votes
Andrew Little April 1, 2019

I am getting this error right now. I have source tree connected to a different GH account and everything works fine. I checked the .pub files are different and the config file is edited properly in my .ssh folder. not sure what else to do. 

Andrew Little April 1, 2019

any ideas @bgannin ? Even when i add the key manually it still wont load my remotes in from that GH project. Super odd

bgannin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 2, 2019

When you run the command "ssh-add -l" does it show all your key(s) loaded into the agent?

Andrew Little April 2, 2019

Hey @bgannin - thanks for replying. Yeah all my keys are there

Daniel Birlem April 23, 2019

I am also getting this error, but everything else related to Github integration seems to be working. Can't push or pull, basically can't do any work with Sourcetree and Github until this is fixed. Bummer!

1 vote
takasurazeem April 14, 2019

It was working fine, all my keys are loaded and Sourctree with GitHub has stopped working, same error!

matt_wassell October 29, 2019

Same issue for me. 

1 vote
bgannin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 19, 2018

Hi Divyesh,

Our apologies for the hiccup. Can you check in Console for any logs from Sourcetree that are printed when this error occurs. Alternatively you can you follow the steps in this article to help debug a bit further hopefully. 

Brian Ganninger
Senior Mac Developer, Sourcetree

Divyesh Parmar November 19, 2018

no there was no logs available in the console. And after few try and errors I was  finally able to set it up with HTTPS and the software itself needs to get restarted before any repos gets loaded so yeah that way now its all set up and working.

Thank you for the response. :)

Yair Hogri March 11, 2019

I keep getting the same error, when I turned debugging on, this log keeps appearing:

2019-03-11 17:27:25 +0000 (e) Error uploading key. Server returned - {"message":"Not Found","documentation_url":"https://developer.github.com/v3/users/keys/#create-a-public-key"}

0 votes
Nikishin Iliya February 17, 2020

For me worked this:

  1. I removed all my added SSH keys on github.com/settings/keys
  2. Removed all credentials and access keys in Keychain Access on Mac OS
  3. Reauthorized GitHub account in Source Tree Settings -> Accounts

Yes, this is very brute force solution, but I was updated to a newly MacBook and didn't transfer data (including SSH keys) from old MacBook. So for me saving old SSH keys was optional.

N.B.! Do not use this solution if you are using your existing SSH keys on other machines.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events