Phymata

Helping you shave yaks

Fixing my OpenStack Gerrit Permission denied (publickey) problem

12 Feb 2014

I was setting up a laptop to contribute some code to OpenStack according to the Gerrit Workflow Account Setup. When I got to the point of doing the git review -s I hit the error

$ git review -s
Problem running 'git remote update gerrit'
Fetching gerrit
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: Could not fetch gerrit
Problems encountered installing commit-msg hook
The following command failed with exit code 1
"scp -P 29418 everett-toews@review.openstack.org:hooks/commit-msg .git/hooks/commit-msg"
-----------------------
Permission denied (publickey).
-----------------------

Searching around I foundĀ Permission denied (publickey) which was helpful in troubleshooting but didn't suggest an answer.

The solution was to let OpenSSH know where my private key was. I added the following to my ~/.ssh/config file.

Host review.openstack.org
    IdentityFile /Box/Keys/id_rsa.openstack

Note: That should be a tab before the IdentityFile!