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

Linux Master and Windows Slave ends up with unusable PATH

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not A Defect
    • None
    • Jenkins master (2.35) running on Centos 7.2 with latest plugins as of today
      Jenkins slave running on Windows Server 2016 as a service started via JNLP

    Description

      When having a pipeline task started on a Linux Master and scheduled to a Windows Slave the PATH is not set correctly but other variables seem to be. Here is a sample:

      node('linux'){
          echo "${env.PATH}"
          echo "${env.JAVA_HOME}"
          echo "${env.PATHEXT}"
      }
      node('windows'){
          echo "${env.PATH}"
          echo "${env.JAVA_HOME}"
          echo "${env.PATHEXT}"
      }
      

      Output:

      Started by user FirstName LastName
      [Pipeline] node
      Running on linux.example.local in /var/lib/jenkins/workspace/jenkins-bug
      [Pipeline] {
      [Pipeline] echo
      /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
      [Pipeline] echo
      null
      [Pipeline] echo
      null
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] node
      Running on windows.example.local in c:\Users\jenkins\workdir\workspace\jenkins-bug
      [Pipeline] {
      [Pipeline] echo
      /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
      [Pipeline] echo
      "C:\Program Files\Java\jdk1.8.0_112"
      [Pipeline] echo
      .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

      Possibly related to:
      https://issues.jenkins-ci.org/browse/JENKINS-23545
      https://issues.jenkins-ci.org/browse/JENKINS-37800
      https://issues.jenkins-ci.org/browse/JENKINS-32000
      https://issues.jenkins-ci.org/browse/JENKINS-40726

      Attachments

        Issue Links

          Activity

            Turns out this was classic PEBKAC...

            In "Manage Jenkins" > "Configure System" > "Global Properties" there was an override of PATH...

            rbjorklin Robin Björklin added a comment - Turns out this was classic PEBKAC ... In "Manage Jenkins" > "Configure System" > "Global Properties" there was an override of PATH...

            People

              Unassigned Unassigned
              rbjorklin Robin Björklin
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: