-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.289.3, durable-task-pipeline 1.39
also Jenkins 2.319.1, durable-task-pipeline 493.v195aefbb0ff2
This is related to multiple issues that are resolved as fix, but there are still ongoing issues:
Running a powershell step where the command is not found OR where the command does NOT generate any stdout when returnStdout: true will hang the job
Use this for the pipeline to duplicate issue:
pipeline { agent { label "john-windows" } stages { stage('gobbledygook - will pass') { steps{ // powershell script: 'gobbledygook' powershell script: 'date' } } stage('gobbledygook - will fail') { steps{ powershell returnStdout: true, script: 'gobbledygook' } } } }
The jobs will hang and will need to be aborted. Here is he console output:
14:05:18 [Pipeline] Start of Pipeline 14:05:19 [Pipeline] node 14:05:34 Still waiting to schedule task 14:05:34 ‘john-windows’ is offline 14:05:51 Running on john-windows in c:\jenkins\workspace\test-powershell-stdout 14:05:51 [Pipeline] { 14:05:51 [Pipeline] stage 14:05:51 [Pipeline] { (gobbledygook - will pass) 14:05:51 [Pipeline] powershell 14:05:57 14:05:57 Wednesday, January 12, 2022 2:05:57 PM 14:05:58 [Pipeline] } 14:05:58 [Pipeline] // stage 14:05:58 [Pipeline] stage 14:05:58 [Pipeline] { (gobbledygook - will fail) 14:05:58 [Pipeline] powershell 14:06:03 Exception calling "WriteAllLines" with "2" argument(s): "Value cannot be null. 14:06:03 Parameter name: contents" 14:06:03 At line:1 char:456 14:06:03 + ... utput.txt"; [IO.File]::WriteAllLines("c:\jenkins\workspace\test-power ... 14:06:03 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 14:06:03 + CategoryInfo : NotSpecified: ( [], MethodInvocationException 14:06:03 + FullyQualifiedErrorId : ArgumentNullException 14:06:03 14:06:03 gobbledygook : The term 'gobbledygook' is not recognized as the name of a cmdlet, function, script file, or operable 14:06:03 program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 14:06:03 At C:\jenkins\workspace\test-powershell-stdout@tmp\durable-58ebe341\powershellScript.ps1:1 char:1 14:06:03 + gobbledygook 14:06:03 + ~~~~~~~~~~~~ 14:06:03 + CategoryInfo : ObjectNotFound: (gobbledygook:String) [], ParentContainsErrorRecordException 14:06:03 + FullyQualifiedErrorId : CommandNotFoundException 14:06:03 14:06:03 14:06:03.275691 common.go:40: exit status 1 14:06:04 Cannot contact john-windows: java.io.FileNotFoundException: c:\jenkins\workspace\test-powershell-stdout@tmp\durable-58ebe341\output.txt (The system cannot find the file specified) 14:07:32 Aborted by Lengeling John M 14:07:32 Sending interrupt signal to process 14:07:47 Click here to forcibly terminate running steps 14:07:52 After 20s process did not stop 14:07:52 [Pipeline] } 14:07:52 [Pipeline] // stage 14:07:52 [Pipeline] } 14:07:52 [Pipeline] // node 14:07:52 [Pipeline] End of Pipeline 14:07:52 Finished: ABORTED
This issue appears related to other tickets but are marked as resolved and fixed in older versions of durable-task-plugin.
I can't duplicate the problem as described. Steps I took:
Plugin versions that I was using are listed in my plugins.txt file.
Does the issue require that I must checkout the Pipeline from SCM?
Is there something else that makes the problem visible to you and not to me?
Are all your plugins currently up to date?
Are you running a different Windows version on the agent than the Windows 10 that I'm running on my agents?
Are you running a different Powershell version?