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

Improve slave Unix/Windows detection and perform error check

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: remoting
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          Fixed in 1.118.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - Fixed in 1.118.
          Hide
          kohsuke 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.

          Show
          kohsuke 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.
          Hide
          kohsuke 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.

          Show
          kohsuke 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.
          Hide
          kohsuke 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

          Show
          kohsuke 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

            People

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

              Dates

              Created:
              Updated:
              Resolved: