Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Won't Fix
-
Component/s: git-client-plugin
-
Labels:None
-
Similar Issues:
Description
While setting up a new windows build slave on a rented virtual windows server (tried server2012 as well as server2016) I keep running into this problem where Jenkins jobs cannot check out from git on the new agent:
stderr: error: cannot run c:\msys64\home\jenkins\jenkins\workspace\test-tools\test@tmp\ssh7559664601978999582.bat: No such file or directory
The required batch file is actually produced and quickly deleted again by the jenkins slave. A script I wrote was able to copy the batch file to a different location before it was deleted. It contains:
@echo off "C:\msys64\usr\bin\ssh.exe" -i "C:\msys64\home\jenkins\jenkins\workspace\test-tools\test@tmp\ssh7913781371770019287.key" -l "git" -o "StrictHostKeyChecking=no" %*
The referenced .key file also exists for a short time and contains the correct private key for the git repository.
It is not clear to me if the file is deleted again before it is invoked, or if it is produced only after it was invoked. I would appreciate pointers how to debug this. Can I introduce wait times after file creation? Since this behaviour is dependent on the windows agent, Windows specific filesystem caching and timing may play a role.
I was able to reproduce this with three different virtual windows servers: 2 windows cloud servers rented at ionos.de (2012 and 2016) and a 2016 server rented from a different provider. When executing this in a virtualbox windows 10 machine running on top of ubuntu on my own hardware, this issue does not show up.
Steps to reproduce:
- Rent a virtual windows server, e.g. from ionos.de
- Install msys2 and install git and ssh through msys2
- Install openjdk12 from zip, add to PATH and set JAVA_HOME
- Define new build agent NEW-WINDOWS-SERVER in Jenkins
- Start Jenkins slave on windows server like this:
- start msys2 bash shell
- inside bash shell, create ssh tunnel to Jenkins host:
- ssh -L 8080:localhost:8080 -L 35900:localhost:35900 -N -f jenkins@my.jenkinshost.example.com
- Download slave.jar from Jenkins
- Start Jenkins slave
- java -jar slave.jar -jnlpUrl http://localhost:8080/computer/NEW-WINDOWS-SERVER/slave-agent.jnlp
- Create test job in Jenkins, which checks out a git repository from a git repository over ssh (somethingj like ssh://git@example.com/example-repo)
- The build steps do not matter, add something simple
- Build now
attaching the complete console output. Jenkins version: 2.177. Git client plugin version: 2.7.7
You might be able to compile a custom version of the git client plugin which includes more diagnostic messages in the batch file with steps like:
in case something is causing those files to not be detected.
You might also try google searches for specific cases where programs related to git report "No such file or directory" on Windows. That message seems to indicate in at least one case that a directory name was expected to be provided in a different format. Another hint indicated that message might be coming from bash rather than from the Windows command processor. If so, then there may be something incorrect in the git client plugin's detection of which operating system command (sh or bat) should be used to launch the process.