Mac OS X: "A keychain cannot be found to store [credentials]"

1

1

I'm trying to use git with a remote repo over the command line in OS X 10.8.4. When I enter my credentials for GitHub every time I perform a git push -u origin master, I get a system saying "A keychain cannot be found to store [my GitHub credentials]." I'm given the option to reset my keychain or continue without storing the creds.

I tried following the instructions given on Apple's site for this situation – although they're a bit outdated.

When I try to reset my keychain, I'm prompted for my login password, which is systematically rejected by the authentication dialog.

I've never had this kind of issue; what's the cause, and how can it be fixed?

Shown in the Keychain Access app:

  • Login

  • System

  • System roots

In the ~/LIbrary/Preferences file:

login.keychain
metadata.keychain
two hidden files with seemingly random alphanumeric names

The permissions for ~/Library/Preferences are

-rw-r--r--

For my personal account, and no permissions are shown for root upon ls -l. This may be the root of the problem; I was trying to push using root.

Jules

Posted 2013-08-13T19:33:11.287

Reputation: 628

What keychain files do you have in your library? What are that folder's permissions? What gets shown in the Keychain Access app? – Daniel Beck – 2013-08-13T19:43:22.377

@DanielBeck Updated my question with that info. – Jules – 2013-08-13T19:49:59.960

1Are you in a root shell when running git? If so, that's the issue. You probably shouldn't do that unless you have a really good reason. Maybe you'd succeed by creating /var/root/Library/Keychains (that's root's home directory) and copying an empty keychain there. – Daniel Beck – 2013-08-13T19:57:03.483

I just tried performing git push -u origin master on the same directory from my (non-root) login shell, and got the same error. – Jules – 2013-08-13T19:58:25.053

1It might also depend on how you entered the root shell. sudo -s keeps your regular user's $HOME, while su/sudo su does not. – Daniel Beck – 2013-08-13T19:58:26.597

Anything interesting in logged in the Console application? – Daniel Beck – 2013-08-13T19:58:59.350

Nothing interesting; in fact, nothing remotely related to git at all. – Jules – 2013-08-13T20:02:02.193

No answers