Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57542

git checkout over ssh fails on windows agents started from msys2 - missing bat file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • git-client-plugin
    • None

      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:
      • 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

            Unassigned Unassigned
            t_herzke_2017 T Herzke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: