1
votes

My Project code is hosted on git and gerrit. I want to integrate gerrit with jenkins. when I enter the SSH path or HTTP path in Source Code Management section (Jenkins) I get below error

ERROR:

Started by timer Building on master in workspace /var/lib/jenkins/workspace/demo [WS-CLEANUP] Deleting project workspace... [WS-CLEANUP] Done Cloning the remote Git repository Cloning repository http://[email protected]:29418/Test_Automation HEAD

git init /var/lib/jenkins/workspace/demo # timeout=10 Fetching upstream changes from http://[email protected]:29418/Test_Automation HEAD git --version # timeout=10 using GIT_ASKPASS to set credentials git fetch --tags --progress http://[email protected]:29418/Test_Automation HEAD +refs/heads/:refs/remotes/origin/ ERROR: Timeout after 10 minutes ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "git fetch --tags --progress http://[email protected]:29418/Test_Automation HEAD +refs/heads/:refs/remotes/origin/" returned status code 143: stdout: stderr: at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:629) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186) at hudson.scm.SCM.checkout(SCM.java:504) at hudson.model.AbstractProject.checkout(AbstractProject.java:1208) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) at hudson.model.Run.execute(Run.java:1798) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) ERROR: Error cloning remote repo 'origin' Finished: FAILURE

1

1 Answers

0
votes

You're cloning from 29418 port using http. Change the repository URL to:

ssh://[email protected]:29418/Test_Automation

Or:

http://[email protected]/Test_Automation

If you have doubts about the correct repository URL to use at the "git clone" command at:

  • Go to Gerrit server web interface
  • Click on Projects > List
  • Search for the Test_Automation project
  • Click on the project name
  • Click on General tab
  • Look at the http and ssh "git clone" command