Gerrit server is not Starting

Article ID:115003597308
2 minute readKnowledge base

Issue

  • The Gerrit server in Jenkins is not starting

  • The logs show:

Feb 24, 2017 11:51:22 AM com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater tryLoadProjectList
INFO: Not connected to myServer, waiting for 1 second(s)
Feb 24, 2017 11:51:22 AM com.sonyericsson.hudson.plugins.gerrit.trigger.version.GerritVersionChecker getGerritVersion
SEVERE: Could not find the Gerrit version for myServer
Feb 24, 2017 11:51:22 AM com.sonyericsson.hudson.plugins.gerrit.trigger.version.GerritVersionChecker createVersionNumber
SEVERE: Gerrit version number is null or the empty string.
Feb 24, 2017 11:51:23 AM com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater tryLoadProjectList
INFO: Not connected to myServer, waiting for 2 second(s)
Feb 24, 2017 11:51:25 AM com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater tryLoadProjectList
INFO: Not connected to myServer, waiting for 4 second(s)
Feb 24, 2017 11:51:29 AM com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater tryLoadProjectList
INFO: Not connected to myServer, waiting for 8 second(s)
Feb 24, 2017 11:51:37 AM com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater tryLoadProjectList
INFO: Not connected to myServer, waiting for 16 second(s)
Feb 24, 2017 11:51:53 AM com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater tryLoadProjectList
INFO: Not connected to myServer, waiting for 32 second(s)
Feb 24, 2017 11:52:25 AM com.sonyericsson.hudson.plugins.gerrit.trigger.GerritProjectListUpdater tryLoadProjectList
INFO: Not connected to myServer, waiting for 64 second(s)

Environment

Resolution

If the Gerrit server has not started for some reason you may need to restart it manually.

1. Restart from the UI

First try to restart the server from the UI. Go to Manage Jenkins  Gerrit Trigger and click on the red ball of the server:

gerrit restart server

This may take a few seconds during which you’ll see the red ball flashing.

If the server has successfully started you should see a blue ball (or green if you have the Green Balls plugin install) like the following:

gerrit restart server successful

2. Restart with a Groovy Script

If for some reason the restart from the UI did not work, you can run the following Groovy script under Manage Jenkins  Script Console (replace $SERVER_NAME by the name of your Gerrit server in Jenkins):

import com.sonyericsson.hudson.plugins.gerrit.trigger.GerritServer
import com.sonyericsson.hudson.plugins.gerrit.trigger.PluginImpl

def serverName = "$SERVER_NAME"

GerritServer server = PluginImpl.getInstance().getServer(serverName);

//Print some information about the connection
println "GerritServer '${server.getName()}"
println " Connected? ${server.isConnected()}"
println " ConnectionError? ${server.isConnectionError()}"
println " isTimeoutWakeup? ${server.timeoutWakeup}"

println " Restarting server...'"
server.restartConnection()

Then check under Manage Jenkins  Gerrit Trigger that you server has successfully restarted. Again, this may take a few seconds.

Troubleshooting Further

To troubleshoot the connection problem further, you can add a logger for the following packages:

com.sonyericsson.hudson.plugins.gerrit
com.sonymobile.tools.gerrit.gerritevents

Then reproduce the steps above and see if you see any errors, warnings or exceptions in the log.

Open a Support ticket if you are stuck at this point adding a Support Bundle generated after adding the logger and the file $JENKINS_HOME/gerrit-trigger.xml.