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

Malformed PATH environment variable on Windows slave (unix syntax used)

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • customtools-plugin
    • None
    • Windows slave

      PATH without the plugin:

      Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;...
      

      PATH with the plugin:

      Path=C:\Users\developer\jenkins\tools\Custom_tool\Maven_3.0.4_for_non-maven_projects_\apache-maven-3.0.4:/C:\Users\developer\jenkins\tools\Custom_tool\Maven_3.0.4_for_non-maven_projects_\apache-maven-3.0.4/bin:C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;...
      

          [JENKINS-14515] Malformed PATH environment variable on Windows slave (unix syntax used)

          Ryan Campbell added a comment -

          Is the job running on the master? If not, what is the OS of the master?

          Ryan Campbell added a comment - Is the job running on the master? If not, what is the OS of the master?

          This particular job was running on a Windows slave, master is Linux. The job is part of multi-configuration project that runs on both Linux and Windows slaves.

          Konstantin Korotkov added a comment - This particular job was running on a Windows slave, master is Linux. The job is part of multi-configuration project that runs on both Linux and Windows slaves.

          Got the same problem, the other way around. My master is Windows and the Linux slave is getting a bad PATH environment variable, where the master's JAVA_HOME/bin got injected:

          PATH=D:\opt\jdk1.6.0_27/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
          

          I noticed the problem when I tried to launch a freestyle job on the slave, executing a shell script. Try the following script to exhibit the bad PATH:

          #!/bin/bash
          env
          

          Olivier Chédru added a comment - Got the same problem, the other way around. My master is Windows and the Linux slave is getting a bad PATH environment variable, where the master's JAVA_HOME/bin got injected: PATH=D:\opt\jdk1.6.0_27/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games I noticed the problem when I tried to launch a freestyle job on the slave, executing a shell script. Try the following script to exhibit the bad PATH: #!/bin/bash env

          Ronen Peleg added a comment -

          I have the same problem! On Windows slave and Jenkins installed on Linux O/S

          Path=D:\Jenkins\tools\Custom_tool\NodeJS-0.9.9:/var/lib/jenkins/D: ...

          Ronen Peleg added a comment - I have the same problem! On Windows slave and Jenkins installed on Linux O/S Path=D:\Jenkins\tools\Custom_tool\NodeJS-0.9.9:/var/lib/jenkins/D: ...

          Oleg Nenashev added a comment -

          Hello,

          I've resolved this issue.
          Pull request: https://github.com/jenkinsci/customtools-plugin/pull/2

          Best regards,
          Oleg Nenashev
          R&D Engineer, Synopsys Inc.
          www.synopsys.com

          Oleg Nenashev added a comment - Hello, I've resolved this issue. Pull request: https://github.com/jenkinsci/customtools-plugin/pull/2 Best regards, Oleg Nenashev R&D Engineer, Synopsys Inc. www.synopsys.com

          Oleg Nenashev added a comment -

          Resolved issue in the version 0.3

          Oleg Nenashev added a comment - Resolved issue in the version 0.3

          Jesse Glick added a comment -

          Behavior may have been changed, but not actually fixed in 0.4.2. You now get

          Path=C:\slave\tools\something;C:\slave\tools\something\bin;:C:\WINDOWS\system32;…
          

          Note the : separating the path addition from the original path, causing the first entry in the original path to be unusable.

          Jesse Glick added a comment - Behavior may have been changed, but not actually fixed in 0.4.2. You now get Path=C:\slave\tools\something;C:\slave\tools\something\bin;:C:\WINDOWS\system32;… Note the : separating the path addition from the original path, causing the first entry in the original path to be unusable.

          Oleg Nenashev added a comment -

          The functionality has been broken in https://github.com/jenkinsci/customtools-plugin/commit/1ed68b4a65642113f4a61da08aa5f2e4da5d5b4b (0.4.1). I'll fix the regression

          Oleg Nenashev added a comment - The functionality has been broken in https://github.com/jenkinsci/customtools-plugin/commit/1ed68b4a65642113f4a61da08aa5f2e4da5d5b4b (0.4.1). I'll fix the regression

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapper.java
          http://jenkins-ci.org/commit/customtools-plugin/6698c8f0cd931bdd823d9e8c6325daf14f7103d7
          Log:
          [FIXED JENKINS-14515] toEnvVars must respect the slave platform when creating a new EnvVars object.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapper.java http://jenkins-ci.org/commit/customtools-plugin/6698c8f0cd931bdd823d9e8c6325daf14f7103d7 Log: [FIXED JENKINS-14515] toEnvVars must respect the slave platform when creating a new EnvVars object.

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapper.java
          http://jenkins-ci.org/commit/customtools-plugin/6f337351a7450d1a29139d9045805a762fae51e5
          Log:
          Merge pull request #20 from jglick/JENKINS-14515-pathsep

          [FIXED JENKINS-14515] Incorrect path separator used on Win slave from Unix master

          Compare: https://github.com/jenkinsci/customtools-plugin/compare/8b09f8bbff45...6f337351a745

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallWrapper.java http://jenkins-ci.org/commit/customtools-plugin/6f337351a7450d1a29139d9045805a762fae51e5 Log: Merge pull request #20 from jglick/ JENKINS-14515 -pathsep [FIXED JENKINS-14515] Incorrect path separator used on Win slave from Unix master Compare: https://github.com/jenkinsci/customtools-plugin/compare/8b09f8bbff45...6f337351a745

            oleg_nenashev Oleg Nenashev
            korotkov Konstantin Korotkov
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: