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

Linux Master and Windows Slave ends up with unusable PATH

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not A Defect
    • Labels:
      None
    • Environment:
      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
    • Similar Issues:

      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

            rbjorklin Robin Björklin created issue -
            civilizeddev Hyeonsoo Lee made changes -
            Field Original Value New Value
            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:
            {code:java}
            node('linux'){
                echo "${env.PATH}"
                echo "${env.JAVA_HOME}"
                echo "${env.PATHEXT}"
            }
            node('windows'){
                echo "${env.PATH}"
                echo "${env.JAVA_HOME}"
                echo "${env.PATHEXT}"
            }
            {code}
            Output:
            {code}
            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
            {code}

            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
            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:
            {code:java}
            node('linux'){
                echo "${env.PATH}"
                echo "${env.JAVA_HOME}"
                echo "${env.PATHEXT}"
            }
            node('windows'){
                echo "${env.PATH}"
                echo "${env.JAVA_HOME}"
                echo "${env.PATHEXT}"
            }
            {code}
            Output:
            {code}
            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
            {code}

            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
            civilizeddev Hyeonsoo Lee made changes -
            Component/s durable-task-plugin [ 18622 ]
            Hide
            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...

            Show
            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...
            rbjorklin Robin Björklin made changes -
            Link This issue is related to JENKINS-23545 [ JENKINS-23545 ]
            rbjorklin Robin Björklin made changes -
            Link This issue is related to JENKINS-37800 [ JENKINS-37800 ]
            rbjorklin Robin Björklin made changes -
            Link This issue is related to JENKINS-32000 [ JENKINS-32000 ]
            rbjorklin Robin Björklin made changes -
            Link This issue is related to JENKINS-40726 [ JENKINS-40726 ]
            rbjorklin Robin Björklin made changes -
            Resolution Not A Defect [ 7 ]
            Status Open [ 1 ] Closed [ 6 ]

              People

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

                Dates

                Created:
                Updated:
                Resolved: