-
Bug
-
Resolution: Not A Defect
-
Major
-
Jenkins Slave on a Window Server 2008 R2, Service Pack1. 64-bit.
I have a Jenkins Master running on a linux box. Several jobs clone repos from Bitbucket but I have a Windows slave which fails with the following error:
Building remotely on slavewin-WIN-9G6KGDM45N7-7b265e7f (swarm slavewin) in workspace D:\workspace\SYS-TEST > C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > C:\Program Files\Git\bin\git.exe config remote.origin.url ssh://git@XXX.git # timeout=10 Fetching upstream changes from ssh://git@git.XXX.git > C:\Program Files\Git\bin\git.exe --version # timeout=10 using GIT_SSH to set credentials rsa / deploy keys > C:\Program Files\Git\bin\git.exe fetch --tags --progress ssh://git@XXX.git +refs/heads/*:refs/remotes/origin/* ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from ssh://git@XXX.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:888) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1155) 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:1819) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Caused by: hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe fetch --tags --progress ssh://git@XXX.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: /c: /c: Is a directory fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
The job is configured passing the credential.
On the Windows side I have installed git-bash:
$ git --version git version 2.19.1.windows.1
and set these environment variables:
GIT_SSH=C:\Program Files\Git\usr\bin\ssh.exe Path=blablabla:C:\Program Files\Git\cmd
If I add the private key in users home/.ssh and type git commands to clone, fetch,etc on the Windows it works. However, when launching the Jenkins job from Master UI it return above error.
From Jenkins Master I have this:
-bash-4.2$ git --version git version 2.18.0 and Jenkins git-client ver 3.9.1
Curiously it was working few days ago but we are not able to identify what changed on Jenkins that make everything crashing when running this slave.
Please use chat or the mailing list to request help with questions related to configuration and authentication. Bug reports are seen by far fewer people than questions in chat and in the mailing list.
Since there was no change in the git plugin or the git client plugin in the time between when it was working and when it was not working, that seems to be a further indication it is not a bug in the git plugin or the git client plugin.
Setting GIT_SSH on the windows agent is unnecessary and should probably not be done. Unless you have some compelling reason that you can explain in detail for setting that environment variable, you should leave it unset.