jenkinsci / jenkinsci/durable-task-plugin

[JENKINS-41339] Environment variables referencing other variables broken

Open
#375 53 comments 0 reactions 0 assignees View on GitHub
component:durable-task-plugin component:workflow-durable-task-step-plugin imported-jira-issue priority:major regression resolution:unresolved
Dominant language
Java
Stars
30
Forks
101
PR merge metrics
No merged PRs in 30d

Description

This seems to have broken fairly recently. I have a global PATH environment variable defined in Jenkins as follows:

PATH: /path/to/toolchain/bin:$PATH

Freestyle jobs work with this. An older version of the durable task plugin also worked. After updating to the latest, this pipeline job:

```
node('master', {
echo 'env.PATH=' + env.PATH
sh('env')
})

```

results in this output:

```
[Pipeline] node
Running on master in /var/lib/jenkins/workspace/pipeline bug
[Pipeline] {
[Pipeline] echo
env.PATH=/path/to/toolchain/bin:$PATH
[Pipeline] sh
[pipeline bug] Running shell script
nohup: failed to run command ‘sh’: No such file or directory
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE

```

---
Originally reported by jtatum, imported from: Environment variables referencing other variables broken


  • status: Reopened
  • priority: Major
  • component(s): durable-task-plugin, workflow-durable-task-step-plugin
  • label(s): blue-pipeline-scrub, regression, triaged-2018-11
  • resolution: Unresolved
  • votes: 27
  • watchers: 51
  • imported: 2025-12-09

Raw content of original issue

This seems to have broken fairly recently. I have a global PATH environment variable defined in Jenkins as follows:

PATH: /path/to/toolchain/bin:$PATH

Freestyle jobs work with this. An older version of the durable task plugin also worked. After updating to the latest, this pipeline job:


node('master', {

echo 'env.PATH=' + env.PATH
sh('env')
})

results in this output:


[Pipeline] node

Running on master in /var/lib/jenkins/workspace/pipeline bug
[Pipeline] {
[Pipeline] echo
env.PATH=/path/to/toolchain/bin:$PATH
[Pipeline] sh
[pipeline bug] Running shell script
nohup: failed to run command ‘sh’: No such file or directory
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE

environment

```
Jenkins 2.41

Durable task plugin 1.13

Centos 6.5
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.