Ask Your Question
0

Error while using git review: Permission denied (publickey)

asked 2014-11-30 11:32:58 -0500

sagardmni gravatar image

Hi,

I'm attempting to send code for review using 'git review', but I'm facing the following error.

root@envy:/home/sagar/gitstuff/horizon# git review
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
Traceback (most recent call last):
  File "/usr/local/bin/git-review", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/git_review/cmd.py", line 1202, in main
    set_hooks_commit_msg(remote, hook_file)
  File "/usr/local/lib/python2.7/dist-packages/git_review/cmd.py", line 283, in set_hooks_commit_msg
    run_command_exc(CannotInstallHook, *cmd)
  File "/usr/local/lib/python2.7/dist-packages/git_review/cmd.py", line 152, in run_command_exc
    raise klazz(rc, output, argv, env)
git_review.cmd.CannotInstallHook: Problems encountered installing commit-msg hook
The following command failed with exit code 1
    "scp -P29418 sagardmni@review.openstack.org:hooks/commit-msg .git/hooks/commit-msg"
-----------------------
Permission denied (publickey).

Any ideas as to what the reason could be?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-12-13 23:40:50 -0500

dilip gravatar image

Looks like an ssh-agent is running already but it can not find any keys attached. To solve this add the private key identities to the authentication agent like so:

ssh-add

edit flag offensive delete link more
0

answered 2014-12-02 13:17:31 -0500

mpetason gravatar image

You are trying to auth with a Public key instead of your Private key? Do you have your public key uploaded so that you have a public/private combo?

edit flag offensive delete link more

Comments

Thanks for the reply. I followed the steps given to generate an ssh key at https://review.openstack.org/#/settings/ssh-keys (https://review.openstack.org/#/settin...) , and then I added the public key. That's all that is required as far as the ssh keys are concerned, right?

sagardmni gravatar imagesagardmni ( 2014-12-04 10:08:29 -0500 )edit

You will need to upload whatever is in "id_rsa.pub" and then you can use id_rsa as your private key. You need a public + private key pair. You auth with your Private key, which the public key is tied to.

mpetason gravatar imagempetason ( 2014-12-04 10:33:36 -0500 )edit

That's what I did. I have no idea why, but cloning the horizon repo again solved the issue. Thanks for your help anyway.

sagardmni gravatar imagesagardmni ( 2014-12-04 11:22:51 -0500 )edit

Weird. I'll clean up our comments and all in a minute. You should write an answer with what you did to resolve it, even though it doesn't really give a root cause.

mpetason gravatar imagempetason ( 2014-12-04 11:41:19 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-11-30 11:32:58 -0500

Seen: 2,521 times

Last updated: Dec 13 '16