jenkinsci / jenkinsci/durable-task-plugin

[JENKINS-54671] Script not found results in success in durable-task-plugin

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

Description

When running the powershell task, if the path you pass doesn't exist, the step does not cause the build to fail:

pipeline:

node("WINDOWS_MACHINE"){

powershell("a_file_that_doesnt_exist")

}

output:

Running in Durability level: MAX_SURVIVABILITY

[Pipeline] node

Running on in D:\J\workspace\TEST_POWERSHELL_STEP

[Pipeline]


{
[Pipeline] powershell
[TEST_POWERSHELL_STEP] Running PowerShell script
powershell.exe : a_file_that_doesnt_exist : The term 'a_file_that_doesnt_exist' is not recognized as the name of a cmdlet, function,
At D:\J\workspace\TEST_POWERSHELL_STEP@​tmp\durable-feef7c1b\powershellWrapper.ps1:5 char:3
+ & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Fi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (a_file_that_doe...let, function, :String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At D:\J\workspace\TEST_POWERSHELL_STEP@​tmp\durable-feef7c1b\powershellScript.ps1:1 char:1
+ a_file_that_doesnt_exist
+ ~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : ObjectNotFound: (a_file_that_doesnt_exist:String) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException

[Pipeline] }

[Pipeline] // node

[Pipeline] End of Pipeline

Finished: SUCCESS

I would expect that unless i have asked for the return code, the step should cause the build to fail. This should act the same way as if the calling script returned an invalid error code.

---
Originally reported by peanderson, imported from: Script not found results in success in durable-task-plugin


  • status: Open
  • priority: Major
  • component(s): durable-task-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-09

Raw content of original issue

When running the powershell task, if the path you pass doesn't exist, the step does not cause the build to fail:
pipeline:
node("WINDOWS_MACHINE"){
powershell("a_file_that_doesnt_exist")
}
output:

Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on <VM NAME> in D:\J\workspace\TEST_POWERSHELL_STEP
[Pipeline]


{
[Pipeline] powershell
[TEST_POWERSHELL_STEP] Running PowerShell script
powershell.exe : a_file_that_doesnt_exist : The term 'a_file_that_doesnt_exist' is not recognized as the name of a cmdlet, function,
At D:\J\workspace\TEST_POWERSHELL_STEP@tmp\durable-feef7c1b\powershellWrapper.ps1:5 char:3
+ & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Fi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (a_file_that_doe...let, function, :String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At D:\J\workspace\TEST_POWERSHELL_STEP@tmp\durable-feef7c1b\powershellScript.ps1:1 char:1
+ a_file_that_doesnt_exist
+ ~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : ObjectNotFound: (a_file_that_doesnt_exist:String) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException

[Pipeline] }

[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

I would expect that unless i have asked for the return code, the step should cause the build to fail. This should act the same way as if the calling script returned an invalid error code.

environment

```
CloudBees Jenkins Enterprise 2.121.1.2-rolling

Durable Task Plugin: 1.22

```

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.