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

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

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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\;...
      

        Attachments

          Issue Links

            Activity

            korotkov Konstantin Korotkov created issue -
            Hide
            recampbell Ryan Campbell added a comment -

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

            Show
            recampbell Ryan Campbell added a comment - Is the job running on the master? If not, what is the OS of the master?
            Hide
            korotkov 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.

            Show
            korotkov 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.
            Hide
            ochedru 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
            
            Show
            ochedru 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
            Hide
            ronenpg 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: ...

            Show
            ronenpg 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: ...
            Hide
            oleg_nenashev 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

            Show
            oleg_nenashev 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 Oleg Nenashev made changes -
            Field Original Value New Value
            Assignee recampbell [ recampbell ] Oleg Nenashev [ oleg_nenashev ]
            oleg_nenashev Oleg Nenashev made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Resolved issue in the version 0.3

            Show
            oleg_nenashev Oleg Nenashev added a comment - Resolved issue in the version 0.3
            oleg_nenashev Oleg Nenashev made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            oleg_nenashev Oleg Nenashev made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            Hide
            jglick 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.

            Show
            jglick 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.
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Reopened [ 4 ]
            jglick Jesse Glick made changes -
            Status Reopened [ 4 ] Open [ 1 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 20 (Web Link)" [ 11504 ]
            Hide
            oleg_nenashev 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

            Show
            oleg_nenashev 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
            Hide
            scm_issue_link 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.

            Show
            scm_issue_link 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.
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 145151 ] JNJira + In-Review [ 191376 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: