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

Improve slave Unix/Windows detection and perform error check

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • remoting
    • None
    • Platform: All, OS: All

      Create an ant build and it works fine on master.
      the output is as follows...

      [ProjectName] $ cmd.exe /C ant.bat publish

      but tie this build to a slave the output becomes

      [ProjectName] $ ant publish

      And the error stack trace...
      FATAL: command execution failed
      java.io.IOException: CreateProcess: ant publish
      at java.lang.ProcessImpl.create(Native Method)
      at java.lang.ProcessImpl.<init>(Unknown Source)
      at java.lang.ProcessImpl.start(Unknown Source)
      at java.lang.ProcessBuilder.start(Unknown Source)
      at java.lang.Runtime.exec(Unknown Source)
      at hudson.Proc$LocalProc.<init>(Proc.java:79)
      at hudson.Launcher$LocalLauncher.launch(Launcher.java:167)
      at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:251)
      at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:235)
      at hudson.remoting.UserRequest.perform(UserRequest.java:57)
      at hudson.remoting.UserRequest.perform(UserRequest.java:22)
      at hudson.remoting.Request$2.run(Request.java:178)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
      Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

      If you attempt to do Runtime.getRuntime.exec("ant publish"); you get the same
      issue. For some reason the ant invocation is not generating as ant.bat which is
      what it needs to be generated as.

          [JENKINS-631] Improve slave Unix/Windows detection and perform error check

          What's the "remote FS root" value of this slave?

          If you don't understand what I'm saying, please send me your $HUDSON_HOME/config.xml

          Kohsuke Kawaguchi added a comment - What's the "remote FS root" value of this slave? If you don't understand what I'm saying, please send me your $HUDSON_HOME/config.xml

          The submitter reported he set "c:/hudson". (mwiles, you can add comments by
          becoming an observer, so please do.)

          The cause of the problem is that Hudson determines Unix/Windows-ness of the
          slave by looking at the remote FS. If the path includes '\' it will be assumed
          to be Windows, and otherwise '/'.

          So to fix this problem you can change your remote FS root to "c:\hudson", and on
          Windows that is the proper path separator.

          Kohsuke Kawaguchi added a comment - The submitter reported he set "c:/hudson". (mwiles, you can add comments by becoming an observer, so please do.) The cause of the problem is that Hudson determines Unix/Windows-ness of the slave by looking at the remote FS. If the path includes '\' it will be assumed to be Windows, and otherwise '/'. So to fix this problem you can change your remote FS root to "c:\hudson", and on Windows that is the proper path separator.

          Changing this issue to reflect the remaining work. The changes that we need to
          make is:

          1. if the remote path includes ':', assume Windows.
          2. when a slave is actually connected, verify the Windows/Unix ness and report
          an error if otherwise.

          Kohsuke Kawaguchi added a comment - Changing this issue to reflect the remaining work. The changes that we need to make is: 1. if the remote path includes ':', assume Windows. 2. when a slave is actually connected, verify the Windows/Unix ness and report an error if otherwise.

          Fixed in 1.118.

          Kohsuke Kawaguchi added a comment - Fixed in 1.118.

            Unassigned Unassigned
            mwiles mwiles
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: