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

2

16

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?

Fuentes answered 23/9, 2014 at 19:49 Comment(5)
I manually added the credentials to keychain and this seems to work.Fuentes
Could you tell us how ?Clown
In keychain : add 'bitbucket.org' entry in 'Passwords' category.Clown
i think your access on this project removed by adminGourmandise
@Fuentes Hi, I had the same issue as you. I put a bounty on your question. jfcartier's answer solved the issue for me. Have you tried his solution yet?Locksmith
E
16

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.

Egbert answered 11/4, 2016 at 2:52 Comment(1)
That worked for me! What is weird is that if I open Keychain access and search for ssh I can see the key there. It was actually the ssh-agent that didn't have it.Locksmith
M
1

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

Margaretemargaretha answered 16/3, 2018 at 2:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.