Friday, March 3, 2017

Jenkins Error : ERROR: Error cloning remote repo 'origin'


If you upgraded and you face following error. 
---------------------------------------------------------------------
Started by user shrikant
Building on master in workspace /var/lib/jenkins/workspace/DEvops
Cloning the remote Git repository
Cloning repository git@xyzserver.com:04761G744/Jpetstore_App.git
 > git init /var/lib/jenkins/workspace/DEvops # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /var/lib/jenkins/workspace/DEvops
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:663)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:464)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1057)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1276)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
at hudson.model.Run.execute(Run.java:1744)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Caused by: hudson.plugins.git.GitException: Error performing command: git init /var/lib/jenkins/workspace/DEvops
---------------------------------------------------------------------------

** Solution is This **

Enter Jenkins System Configure (Jenkins -> Manage Jenkins -> Configure System )
When you mention absolute path.

 Go Here
and check your git path e.g. /bin/git or /usr/local/bin/git, /usr/bin/git etc.
This error will go away!