jenkinsci / jenkinsci/workflow-durable-task-step-plugin

[JENKINS-46980] Jobname with single quote breaks pipeline sh command

Open
#540 5 comments 0 reactions 0 assignees View on GitHub
component:workflow-durable-task-step-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
46
Forks
110
PR merge metrics
No merged PRs in 30d

Description

Using a backtick in the Job name does not work together with the sh command in a pipeline.

E.g. a pipeline job with the name "Developer Test" and the following pipeline script

node{

sh 'echo "hello world"'
}

will print "hello world".

Changing the name of the Job to "Developer's Test" (or any other name with a single backtick) breaks the build and fails with "ERROR: script returned exit code -2".

I would expect a more expressive error message in the pipeline or a check to forbid such characters in the job name.

---
Originally reported by dhaftstein, imported from: Jobname with single quote breaks pipeline sh command


  • status: Open
  • priority: Minor
  • component(s): workflow-durable-task-step-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 20251212-090250

Raw content of original issue

Using a backtick in the Job name does not work together with the sh command in a pipeline.
E.g. a pipeline job with the name "Developer Test" and the following pipeline script



node{

sh 'echo "hello world"'
}


will print "hello world".

Changing the name of the Job to "Developer's Test" (or any other name with a single backtick) breaks the build and fails with "ERROR: script returned exit code -2".

I would expect a more expressive error message in the pipeline or a check to forbid such characters in the job name.

  • environment: Jenkins 2.60.1 on Linux 64 bit

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.