Ask Your Question
1

Could not connect to gerrit

asked 2015-03-19 05:54:00 -0600

benbracha gravatar image

updated 2015-03-19 12:12:36 -0600

I cannot do "git review", although I created a user and followed the instructions. Here is the exception. Any idea?

Could not connect to gerrit.
Enter your gerrit username: benbracha
Trying again with ssh://benbracha@review.openstack.org:29418/openstack/openstack-planet.git
<traceback object at 0x106bac908>
We don't know where your gerrit is. Please manually create a remote
named "gerrit" and try again.
Traceback (most recent call last):
  File "/usr/local/bin/git-review", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/git_review/cmd.py", line 1173, in main
    config['hostname'], config['port'], config['project'])
  File "/usr/local/lib/python2.7/site-packages/git_review/cmd.py", line 593, in check_remote
    add_remote(scheme, hostname, port, project, remote)
  File "/usr/local/lib/python2.7/site-packages/git_review/cmd.py", line 333, in add_remote
    raise Exception("Could not connect to gerrit at %s" % remote_url)
Exception: Could not connect to gerrit at ssh://benbracha@review.openstack.org:29418/openstack/openstack-planet.git

Thanks

edit retag flag offensive close merge delete

5 answers

Sort by ยป oldest newest most voted
4

answered 2015-03-19 09:53:46 -0600

updated 2015-03-19 13:27:22 -0600

The most likely cause is that you are on a network which has some sort of egress blocking firewall, or you're running local packet filtering software which is preventing you from opening remote connections to 29418/tcp. Can you confirm or try from another network/machine?

You can also test for this condition if you have netcat installed by running nc review.openstack.org 29418 and seeing whether you get back "SSH-2.0-GerritCodeReview_2.8.4-15-g6dc8444 (SSHD-CORE-0.9.0.201311081)" followed by a bunch of gibberish (in which case you are able to reach the server successfully), or whether you get an error message instead.

If that's working, then rule out whether your SSH key is the problem by running ssh -p 29418 benbracha@review.openstack.org gerrit version and see whether you get back "gerrit version 2.8.4-15-g6dc8444" or an error like "Permission denied (publickey)."

If you're getting a permission denied, double-check that the username at https://review.openstack.org/#/settings/ is right and that your SSH key at https://review.openstack.org/#/settin... matches the contents of your ~/.ssh/id_rsa.pub file.

edit flag offensive delete link more

Comments

OK. I've just got

[dbaxps@junoFedora21 nova-docker]$ ssh -p 29418 dbaxps@review.openstack.org gerrit version
gerrit version 2.8.4-15-g6dc8444
dbaxps gravatar imagedbaxps ( 2015-03-19 13:08:09 -0600 )edit

Yep, sorry, I meant benbracha in this case.

fungi gravatar imagefungi ( 2015-03-19 13:28:07 -0600 )edit

It doesn't matter. Please, view my updated answer

dbaxps gravatar imagedbaxps ( 2015-03-19 13:29:58 -0600 )edit

He reported receiving a "Permission denied (publickey)." error and you did not. Also git review should add a "gerrit" git remote for you based on the contents of that git repository's .gitreview file and your username. If it did not in your case then something else is wrong. What git-review release?

fungi gravatar imagefungi ( 2015-03-19 14:47:35 -0600 )edit

It is git-review-1.24-4.fc21.noarch

dbaxps gravatar imagedbaxps ( 2015-03-19 15:12:50 -0600 )edit
3

answered 2015-05-22 07:43:36 -0600

dasm gravatar image

updated 2015-11-30 07:55:11 -0600

It can also be a problem with gerrit itself. Even if everything seems to be already setup, all access is added, but still you're receiving info Could not connect to gerrit you can try to manually add repo by:

git remote add gerrit ssh://username@review.openstack.org:29418/openstack/project.git
edit flag offensive delete link more

Comments

That solution has worked for me, thanks @dasm!

Aliaksandr Buhayeu gravatar imageAliaksandr Buhayeu ( 2015-11-04 12:14:55 -0600 )edit
0

answered 2016-01-04 16:09:40 -0600

nutshi gravatar image

updated 2016-01-04 16:11:47 -0600

Need more help

I am getting and I verified that my ssh key is correct on review.openstack

python-heatclient njain$ nc review.openstack.org 29418 SSH-2.0-GerritCodeReview_2.11.4-11-ga14450f (SSHD-CORE-0.14.0)

Unsupported protocol version:

I am getting the same error

:python-heatclient njain$ 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

I have added the gerrit remote

:python-heatclient njain$ git remote -v gerrit ssh://my@review.openstack.org:29418/openstack/python-heatclient.git (fetch) gerrit ssh://my@review.openstack.org:29418/openstack/python-heatclient.git (push) origin https://github.com/openstack/python-h... (fetch) origin https://github.com/openstack/python-h... (push)

more info ssh -p 29418 review.openstack.com gerrit show-connections ssh: Could not resolve hostname review.openstack.com: nodename nor servname provided, or not known

edit flag offensive delete link more
0

answered 2016-04-01 20:43:47 -0600

karthikprabhu gravatar image

I am getting an error on running nc.

ubuntu@karthikvm:/opt/stack/cinder$ nc http://review.openstack.org 29418 nc: getaddrinfo: Name or service not known

edit flag offensive delete link more
-1

answered 2015-03-19 07:42:57 -0600

dbaxps gravatar image

updated 2015-03-19 16:49:12 -0600

Done just now. First run ssh test

[dbaxps@junoFedora21 nova-docker]$ ssh -p 29418 dbaxps@review.openstack.org gerrit version
gerrit version 2.8.4-15-g6dc8444

Following https://ask.openstack.org/en/question...
I've signed ICLA after that situation has changed

[dbaxps@junoFedora21 test2]$ git clone http://github.com/stackforge/nova-docker.git
Cloning into 'nova-docker'...
remote: Counting objects: 1390, done.
remote: Total 1390 (delta 0), reused 0 (delta 0), pack-reused 1390
Receiving objects: 100% (1390/1390), 347.13 KiB | 519.00 KiB/s, done.
Resolving deltas: 100% (719/719), done.
Checking connectivity... done.
[dbaxps@junoFedora21 test2]$ cd nova*
[dbaxps@junoFedora21 nova-docker]$ git review -s
Creating a git remote called "gerrit" that maps to:
    ssh://dbaxps@review.openstack.org:29418/stackforge/nova-docker.git

Thank you for instructing me how to manage

edit flag offensive delete link more

Comments

git-review does that for you automatically, and the URL in the error message looks fine, so this isn't the problem.

fungi gravatar imagefungi ( 2015-03-19 09:51:46 -0600 )edit

Thanks for the answer. Well trying to do that actually made some change, I'm now getting different exception:

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 acc

benbracha gravatar imagebenbracha ( 2015-03-19 10:48:57 -0600 )edit

Aha, the "Permission denied (publickey)." you're seeing there suggests that the username or SSH key is incorrect. Check those per my suggestions in the other answer.

fungi gravatar imagefungi ( 2015-03-19 12:14:32 -0600 )edit

Command suggested by myself I found in official gerrit manuals when tried to submit patch for "nova-docker". It's not my fantasy && it worked for me.Finally resuming git review -s

dbaxps gravatar imagedbaxps ( 2015-03-19 12:18:59 -0600 )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: 2015-03-19 05:52:53 -0600

Seen: 13,053 times

Last updated: Jan 04 '16