• Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Critical Critical
    • jenkins-1.611 and Windows with cygwin installed and configured SSH server.

      The ssh part works properly and Jenkins succeeds on copying the slave.jar file and executes it but it seems that it does make some wrong assumptions about paths, giving the error below:

      [marvin] $ /bin/bash C:\Users\Administrator\hudson5000371039477233927.sh
      hudson.util.IOException2: Slave JVM has not reported exit code. Is it still running?
      	at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:953)
      	at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:133)
      Caused by: java.io.IOException: Cannot run program "/bin/bash" (in directory "C:\tools\cygwin\home\Administrator\marvin\marvin"): CreateProcess error=3, The system cannot find the path specified
      	at java.lang.ProcessBuilder.start(Unknown Source)
      	at hudson.Proc$LocalProc.<init>(Proc.java:244)
      

      Full log at https://gist.github.com/ssbarnea/370949586b622f751d07

      The windows path is correct, being created by Jenkins, but it seems that he execution of /bin/bash is the one that fails. If one does manually performs ssh to the machine, using the same credentials, they would be able to run /bin/bash.
      I believe that the problem is because Jenkins is assuming that being a Windows machine it has to provide a Windows path to the CreateProcess which probably expects a Unix path instead because the entire shell is run under cygwin.
      Still, I tried any combinations of configuring the slave path on the node configuration but none seems to work.

          [JENKINS-29105] java.io.IOException: Cannot run program

          Sorin Sbarnea added a comment - - edited

          Based on https://wiki.jenkins-ci.org/display/JENKINS/SSH+slaves+and+Cygwin page it seems that I need to add a new plugin, https://wiki.jenkins-ci.org/display/JENKINS/Cygpath+Plugin

          Still, even after I installed the cygpath plugin, Jenkins keeps giving me the same kind of errors.

          Sorin Sbarnea added a comment - - edited Based on https://wiki.jenkins-ci.org/display/JENKINS/SSH+slaves+and+Cygwin page it seems that I need to add a new plugin, https://wiki.jenkins-ci.org/display/JENKINS/Cygpath+Plugin Still, even after I installed the cygpath plugin, Jenkins keeps giving me the same kind of errors.

          Sorin Sbarnea added a comment -

          Expired: not using Windows anymore so if someone else is able to reproduce the bug feel free to reopen it.

          Sorin Sbarnea added a comment - Expired: not using Windows anymore so if someone else is able to reproduce the bug feel free to reopen it.

          Justin Quinn added a comment - - edited

          I was able to reproduce the above error by copying over a project from one that was set up to run on a Linux build agent. In 'Configure' -> 'Build' -> 'Execute shell' -> 'Command', I remove the shebang (which was set to /bin/bash) and the project ran just fine subsequently.

          NOTE:

          • If you do not have an 'Execute shell' -> 'Command' section in your project configuration, modify the script that drives your project.
          • You could also change the shebang to, for example, !C:\msys64\usr\bin\bash, which is the Windows path equivalent of /usr/bin/bash (if running MSYS2, your path to bash should be the same, but run which bash and modify the shebang as needed).

          Justin Quinn added a comment - - edited I was able to reproduce the above error by copying over a project from one that was set up to run on a Linux build agent. In 'Configure' -> 'Build' -> 'Execute shell' -> 'Command', I remove the shebang (which was set to /bin/bash ) and the project ran just fine subsequently. NOTE: If you do not have an 'Execute shell' -> 'Command' section in your project configuration, modify the script that drives your project. You could also change the shebang to, for example, !C:\msys64\usr\bin\bash, which is the Windows path equivalent of /usr/bin/bash (if running MSYS2, your path to bash should be the same, but run which bash and modify the shebang as needed).

            kohsuke Kohsuke Kawaguchi
            ssbarnea Sorin Sbarnea
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: