Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error (internetKeychainItemForServer:withUsername:path:port:protocol:) - The specified item could not be found in the keychain

I get the following error while I try to push my code to github using Sourcetree:

Pushing to http://github.myOrg.com/my-repo/my-proj.git
2014-09-23 13:05:20.500 git-credential-sourcetree[6744:507] Error (internetKeychainItemForServer:withUsername:path:port:protocol:) - The specified item could not be found in the keychain.
remote: Permission to ion-my-repo/my-proj.git denied to my-user-id.
fatal: unable to access 'http://github.myOrg.com/my-repo/my-proj.git/': The requested URL returned error: 403

When I hit push, sourcetree asks me for my password related to my account:

Password required
For user my-user-id on host github.myOrg.com

So it looks like sourcetree knows what is my user id and it just needs the password to access my github account. I am able to pull the contents using sourcetree and it doesn't ask me for my credentials. I was also able to do push to this project, but recently my system admin did something on my mac with keychains and since then I am not able to push anything on github.

Did anyone came across this issue before?

like image 620
tech_human Avatar asked Sep 23 '14 19:09

tech_human


2 Answers

I was having the exact same issue. It seems that ssh agent somehow lost my credentials. I realized it when I attempted to list all my ssh keys using the terminal:

$ ssh-add -l
> The agent has no identities.

So I ran

$ ssh-add ~/.ssh/my_rsa_key

I entered the password for my key. And the issue went away.

So, I don't know exactly why or how my ssh agent lost its keys all of a sudden but if that is the same problem you are having, you can solve by adding the ssh key back using ssh-add command.

This might be one of those issues that have many different causes and solutions, I am just proposing a solution for my case.

like image 99
jfcartier Avatar answered Nov 09 '22 11:11

jfcartier


I get the same error because of the "two-factor authentication". Once you use the "two-factor authentication" you have to creat a personal access token, and you should enter it instead of your password when performing Git operations over HTTPS. Creating a personal access token for the command line

like image 1
Yangjing Avatar answered Nov 09 '22 11:11

Yangjing