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:
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 email@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://firstname.lastname@example.org/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