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

Node environment variables not recursively expanded

      A user reported a problem whereby a script

      node('some-slave') {
        sh 'echo hello'
      }
      

      would fail, claiming the shell interpreter could not be found. In fact

      echo env.PATH
      

      revealed a mangled path like

      /usr/local/bin:$PATH:$SOME_TOOL/bin
      

      with various unexpanded variables. The node in question had the custom environment variable property set, where in particular PATH was set to an expression involving $PATH as well as various other sister properties.

      Freestyle projects were building without problem on this node, so it seems that the Workflow node step was failing to expand variable references picked up from the custom property.

          [JENKINS-28990] Node environment variables not recursively expanded

          Jesse Glick created issue -
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 163855 ] New: JNJira + In-Review [ 181406 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]
          Jesse Glick made changes -
          Component/s New: workflow-durable-task-step-plugin [ 21715 ]
          Component/s Original: pipeline [ 21692 ]
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-41339 [ JENKINS-41339 ]
          Jesse Glick made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: