For a tutorial of using Gerrit, this external wiki page is very helpful:  https://www.mediawiki.org/wiki/Gerrit/Tutorial

Here we try to gather frequently asked questions about Gerrit access and provide information on how to debug and resolve.  If your question is not listed, please add to the end of this page.

Cannot Clone

This is usually a network access issue.  Make sure the local network admin has opened access:

  1. the hostname gerrit.o-ran-sc.org is resolvable;
  2. gerrit.o-ran-sc.org is ping-able;
  3. ports needed by git clone are open.
    1. Git clone can be done in three different ways: http, https, or ssh.  Their ports are 80, 443, and 29418 respectively. 

Cannot Push to Master Branch

With Gerrit review workflow, master branch is not directly accessible.  Code change is pushed onto a temp reference branch, and merged onto master branch by Gerrit server when a repo committer accepts the change.

Cannot Create/Push My Own Branch

Everybody can clone then create local branch on his/her dev machine.  But not all can push new branch to gerrit.  Only committers of a repo can create branches.

Thus the Pull Request workflow of git is not used here.  See the external wiki page referenced above for a tutorial on how to submit code changes.

Cannot "git review -s"

This problem may occur due to a number of reasons.  Because this step involves ssh connection to gerrit.o-ran-sc.org on a specific port for verifying ssh-key handshake, the following steps can help narrow down the issue. 

  1. Local firewall may block such outgoing traffic. 
    1. Run :  nc gerrit.o-ran-sc.org 29418
    2. We should see something similar to: “SSH-2.0-GerritCodeReview_2.16.8 (SSHD-CORE-2.0.0)”.  If not, most likely your local firewall is blocking outgoing traffic on port 29418.  This can either be resolved by working with local IT networking staff, or switch to a different access.
  2. If step 1 test passes, the next is to verify that ssh is working:
    1. ssh -p 29418 {{ your Linux Foundation ID }}@gerrit.o-ran-sc.org gerrit version
    2. This command basically ssh into the gerrit server and run a simple version check command.  We should see something like:  gerrit version 2.16.8.  If not, our ssh client is not configured correctly.  Most likely the ssh key is not configured properly.  We can now follow ssh debug process to figure what the problem is.  Fir example, running option "-vvv" with the ssh command.
  3. Because the O-RAN SC project requires all contributors to sign contribution agreement, "git review -s" will not work if the contributor has not done so.  This can be verified by running:  git push --dry-run ssh://{{ your Linux Foundation ID }}@gerrit.o-ran-sc.org:29418/it/dep --all. .  If the CLAs have been signed, the expected response is: "Everything up-to-date".  Otherwise, please proceed to sign the CLAs by following this tutorial:  Signing Contributor License Agreement.
  4. If all previous steps work, the next suspect is local Gerrit/git configuration.