• Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • durable-task-plugin
    • Jenkins ver. 1.652 (war)
      durable-taks 1.8
      windows 7 64 bit
      python 3.5 64 bit
      Oracle JRE v8 update 73

      After updating durable-task from 1.7 to 1.8 workflow builds execute bat steps and hang.
      Example of workflow script:
      node {
      bat 'python TaskFor1C.py'
      echo 'end'
      }
      In TaskFor1C.py start program (1cv8.exe) with parametr using metod subprocess.call(). Program start and working as expected but after close workflow hang and in log little spinning icon, but need 'end'.
      After switching back to durable-task version 1.7 everything is working again as expected.

          [JENKINS-33456] durable-task 1.8 breaks workflow bat steps

          Aleksei Vakulenko created issue -

          Jesse Glick added a comment -

          Given JENKINS-32000 I wonder if I should just have some global configuration pulldown for Windows users letting them select an arbitrary version of the code after trial and error.

          What version of Windows do you run? Do you have a way of reproducing from scratch? Are you able to ascertain whether the control directory is created, and if so, whether the correct output is sent to it?

          Jesse Glick added a comment - Given JENKINS-32000 I wonder if I should just have some global configuration pulldown for Windows users letting them select an arbitrary version of the code after trial and error. What version of Windows do you run? Do you have a way of reproducing from scratch? Are you able to ascertain whether the control directory is created, and if so, whether the correct output is sent to it?
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-32000 [ JENKINS-32000 ]

          Aleksei Vakulenko added a comment - - edited

          I think problem not only this plugin, but in some plugin of Pipeline v 1.15.
          Version of Windows - 7 64 bit SP1.
          In example program 1c.exe replaced 7z.exe

          simple script on python:

          # coding: utf8
          import subprocess
          import os
          import time
          
          def main():
          	call_string = 'C:\\Program Files\\7-Zip\\7z.exe t ' + os.getcwd() + '\\Empty.7z'
          	print(call_string)
          	subprocess.call(call_string)
          	time.sleep(10)
          	
          if __name__ == '__main__':
          	main()
          

          workflow script for test:

          node{
              wrap([$class: 'TimestamperBuildWrapper']) {
          		stash includes: 'Python.py, Empty.7z', name: 'zip'
          		timeout(10) {
          			bat 'python python.py'
          		}
          	}
          }
          
          parallel Branch1: {
          		node {
          			wrap([$class: 'TimestamperBuildWrapper']) {
          			    unstash 'zip'
          			    timeout(10) {
          					bat 'python python.py'
          				}
          			}
          		}
          	},Branch2: {
          		node {
          			wrap([$class: 'TimestamperBuildWrapper']) {
          			    unstash 'zip'
          				timeout(10) {
          					bat 'python python.py'
          				}
          			}
          		}
          	}
          	failFast: false
          

          workflow log:

          [Pipeline] Allocate node : Start
          Running on мастер in C:\Jenkins\workspace\UT_Develop
          [Pipeline] node {
          [Pipeline] General Build Wrapper : Start
          [Pipeline] wrap {
          [Pipeline] stash
          19:31:21 Stashed 1 file(s)
          [Pipeline] Enforce time limit : Start
          [Pipeline] timeout {
          [Pipeline] bat
          19:31:21 [UT_Develop] Running batch script
          19:31:21 
          19:31:21 C:\Jenkins\workspace\UT_Develop>python python.py 
          19:31:21 
          19:31:21 7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
          19:31:21 
          19:31:21 
          19:31:21 Error:
          19:31:21 cannot find archive
          19:32:28 C:\Program Files\7-Zip\7z.exe t C:\Jenkins\workspace\UT_Develop\Empty.7z
          [Pipeline] } //timeout
          [Pipeline] Enforce time limit : End
          [Pipeline] } //wrap
          [Pipeline] General Build Wrapper : End
          [Pipeline] } //node
          [Pipeline] Allocate node : End
          [Pipeline] Execute in parallel : Start
          [Pipeline] [Branch1] parallel { (Branch: Branch1)
          [Pipeline] [Branch2] parallel { (Branch: Branch2)
          [Pipeline] [Branch1] Allocate node : Start
          [Branch1] Running on мастер in C:\Jenkins\workspace\UT_Develop
          [Pipeline] [Branch2] Allocate node : Start
          [Branch2] Running on мастер in C:\Jenkins\workspace\UT_Develop@2
          [Pipeline] [Branch1] node {
          [Pipeline] [Branch2] node {
          [Pipeline] [Branch1] General Build Wrapper : Start
          [Pipeline] [Branch1] wrap {
          [Pipeline] [Branch2] General Build Wrapper : Start
          [Pipeline] [Branch2] wrap {
          [Pipeline] [Branch1] unstash
          [Pipeline] [Branch2] unstash
          [Pipeline] [Branch1] Enforce time limit : Start
          [Pipeline] [Branch1] timeout {
          [Pipeline] [Branch2] Enforce time limit : Start
          [Pipeline] [Branch2] timeout {
          [Pipeline] [Branch1] bat
          19:32:29 [Branch1] [UT_Develop] Running batch script
          [Pipeline] [Branch2] bat
          19:32:29 [Branch1] 
          19:32:29 [Branch1] C:\Jenkins\workspace\UT_Develop>python python.py 
          19:32:29 [Branch1] 
          19:32:29 [Branch1] 7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
          19:32:29 [Branch1] 
          19:32:29 [Branch1] 
          19:32:29 [Branch1] Error:
          19:32:29 [Branch1] cannot find archive
          19:32:29 [Branch2] [UT_Develop@2] Running batch script
          19:32:29 [Branch2] 
          19:32:29 [Branch2] C:\Jenkins\workspace\UT_Develop@2>python python.py 
          19:32:29 [Branch2] 
          19:32:29 [Branch2] 7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
          19:32:29 [Branch2] 
          19:32:29 [Branch2] 
          19:32:29 [Branch2] Error:
          19:32:29 [Branch2] cannot find archive
          19:33:37 [Branch1] C:\Program Files\7-Zip\7z.exe t C:\Jenkins\workspace\UT_Develop\Empty.7z
          19:33:37 [Branch2] C:\Program Files\7-Zip\7z.exe t C:\Jenkins\workspace\UT_Develop@2\Empty.7z
          [Pipeline] } //timeout
          [Pipeline] Enforce time limit : End
          [Pipeline] } //wrap
          [Pipeline] General Build Wrapper : End
          [Pipeline] } //node
          [Pipeline] Allocate node : End
          [Pipeline] } //parallel
          

          and "little spinning icon"

          sorry my text decoration

          Aleksei Vakulenko added a comment - - edited I think problem not only this plugin, but in some plugin of Pipeline v 1.15. Version of Windows - 7 64 bit SP1. In example program 1c.exe replaced 7z.exe simple script on python: # coding: utf8 import subprocess import os import time def main(): call_string = 'C:\\Program Files\\7-Zip\\7z.exe t ' + os.getcwd() + '\\Empty.7z' print(call_string) subprocess.call(call_string) time.sleep(10) if __name__ == '__main__' : main() workflow script for test: node{ wrap([$class: 'TimestamperBuildWrapper' ]) { stash includes: 'Python.py, Empty.7z' , name: 'zip' timeout(10) { bat 'python python.py' } } } parallel Branch1: { node { wrap([$class: 'TimestamperBuildWrapper' ]) { unstash 'zip' timeout(10) { bat 'python python.py' } } } },Branch2: { node { wrap([$class: 'TimestamperBuildWrapper' ]) { unstash 'zip' timeout(10) { bat 'python python.py' } } } } failFast: false workflow log: [Pipeline] Allocate node : Start Running on мастер in C:\Jenkins\workspace\UT_Develop [Pipeline] node { [Pipeline] General Build Wrapper : Start [Pipeline] wrap { [Pipeline] stash 19:31:21 Stashed 1 file(s) [Pipeline] Enforce time limit : Start [Pipeline] timeout { [Pipeline] bat 19:31:21 [UT_Develop] Running batch script 19:31:21 19:31:21 C:\Jenkins\workspace\UT_Develop>python python.py 19:31:21 19:31:21 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 19:31:21 19:31:21 19:31:21 Error: 19:31:21 cannot find archive 19:32:28 C:\Program Files\7-Zip\7z.exe t C:\Jenkins\workspace\UT_Develop\Empty.7z [Pipeline] } //timeout [Pipeline] Enforce time limit : End [Pipeline] } //wrap [Pipeline] General Build Wrapper : End [Pipeline] } //node [Pipeline] Allocate node : End [Pipeline] Execute in parallel : Start [Pipeline] [Branch1] parallel { (Branch: Branch1) [Pipeline] [Branch2] parallel { (Branch: Branch2) [Pipeline] [Branch1] Allocate node : Start [Branch1] Running on мастер in C:\Jenkins\workspace\UT_Develop [Pipeline] [Branch2] Allocate node : Start [Branch2] Running on мастер in C:\Jenkins\workspace\UT_Develop@2 [Pipeline] [Branch1] node { [Pipeline] [Branch2] node { [Pipeline] [Branch1] General Build Wrapper : Start [Pipeline] [Branch1] wrap { [Pipeline] [Branch2] General Build Wrapper : Start [Pipeline] [Branch2] wrap { [Pipeline] [Branch1] unstash [Pipeline] [Branch2] unstash [Pipeline] [Branch1] Enforce time limit : Start [Pipeline] [Branch1] timeout { [Pipeline] [Branch2] Enforce time limit : Start [Pipeline] [Branch2] timeout { [Pipeline] [Branch1] bat 19:32:29 [Branch1] [UT_Develop] Running batch script [Pipeline] [Branch2] bat 19:32:29 [Branch1] 19:32:29 [Branch1] C:\Jenkins\workspace\UT_Develop>python python.py 19:32:29 [Branch1] 19:32:29 [Branch1] 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 19:32:29 [Branch1] 19:32:29 [Branch1] 19:32:29 [Branch1] Error: 19:32:29 [Branch1] cannot find archive 19:32:29 [Branch2] [UT_Develop@2] Running batch script 19:32:29 [Branch2] 19:32:29 [Branch2] C:\Jenkins\workspace\UT_Develop@2>python python.py 19:32:29 [Branch2] 19:32:29 [Branch2] 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 19:32:29 [Branch2] 19:32:29 [Branch2] 19:32:29 [Branch2] Error: 19:32:29 [Branch2] cannot find archive 19:33:37 [Branch1] C:\Program Files\7-Zip\7z.exe t C:\Jenkins\workspace\UT_Develop\Empty.7z 19:33:37 [Branch2] C:\Program Files\7-Zip\7z.exe t C:\Jenkins\workspace\UT_Develop@2\Empty.7z [Pipeline] } //timeout [Pipeline] Enforce time limit : End [Pipeline] } //wrap [Pipeline] General Build Wrapper : End [Pipeline] } //node [Pipeline] Allocate node : End [Pipeline] } //parallel and "little spinning icon" sorry my text decoration

          Christophe Carpentier added a comment - - edited

          Same here, using a ant file.

          The groovy script:

          node
          {
              def antHome = tool 'Ant'
              
              stage '32 bits'
              wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2]) {
                  bat "${antHome}/bin/ant.bat build-all -Dplatform=Win32" 
              }
          }
          

          The ant file, reduced to a SSCCE (though requiring AntLibs):

          <?xml version="1.0"?>
          <project name="Minimal JENKINS-33456" basedir=".">
          
          	<taskdef resource="net/sf/antcontrib/antlib.xml" />
          	
          	<target name="compile">
          		<exec executable="AnExecThatDontExist" spawn="false" failonerror="true"></exec>
          	</target>
          	
          	<target name="build-all">
          		<antcallback target="compile"></antcallback>
          	</target>
          </project>
          

          Please note that switching the highlighted failonerror parameter to false solves the problem. The true setting must trigger some kind of exit /b.

          Christophe Carpentier added a comment - - edited Same here, using a ant file. The groovy script: node { def antHome = tool 'Ant' stage '32 bits' wrap([$class: 'AnsiColorBuildWrapper' , 'colorMapName' : 'XTerm' , 'defaultFg' : 1, 'defaultBg' : 2]) { bat "${antHome}/bin/ant.bat build-all -Dplatform=Win32" } } The ant file, reduced to a SSCCE (though requiring AntLibs): <?xml version= "1.0" ?> <project name= "Minimal JENKINS-33456" basedir= "." > <taskdef resource= "net/sf/antcontrib/antlib.xml" /> <target name= "compile" > <exec executable= "AnExecThatDontExist" spawn= "false" failonerror= "true" > </exec> </target> <target name= "build-all" > <antcallback target= "compile" > </antcallback> </target> </project> Please note that switching the highlighted failonerror parameter to false solves the problem. The true setting must trigger some kind of exit /b.

          Daniel Weber added a comment -

          We also encountered problems where bat steps dis not finish. It looked like the result.txt file that Jenkins is waiting for was never created although the batch scripts were done. The 2 .bat files and log file existed in the "...@tmp" folder.

          Downgrading durable-tasks to 1.7 helped.

          Running Jenkins 1.625.3 under Windows Server 2008 R2, pipeline plugins versions 1.14.

          Daniel Weber added a comment - We also encountered problems where bat steps dis not finish. It looked like the result.txt file that Jenkins is waiting for was never created although the batch scripts were done. The 2 .bat files and log file existed in the "...@tmp" folder. Downgrading durable-tasks to 1.7 helped. Running Jenkins 1.625.3 under Windows Server 2008 R2, pipeline plugins versions 1.14.

          I've read this issue history, and man, this doesn't look easy.
          Might I suggest using START /wait as an alternative to CALL, and use %ERRORLEVEL% to retrieve the result?
          Source: http://stackoverflow.com/questions/13257571/call-command-vs-start-with-wait-option

          I'd also suggest a kind of unit-test-job that does all kind of calls, start, cmds... and check in which case you manage to get the result; in any case it should not hang.

          Christophe Carpentier added a comment - I've read this issue history, and man, this doesn't look easy. Might I suggest using START /wait as an alternative to CALL, and use %ERRORLEVEL% to retrieve the result? Source: http://stackoverflow.com/questions/13257571/call-command-vs-start-with-wait-option I'd also suggest a kind of unit-test-job that does all kind of calls, start, cmds... and check in which case you manage to get the result; in any case it should not hang.

          Still present in 2.0-rc.
          jglick and vakulenko_alex, I don't understand why this issue is a blocker, and yet it doesn't seem to hinder the promotion of the version from beta to RC.
          And please don't tell us we can work around it by changing the way our bats are called: I'm not going to change all my Ant scripts, then change again the next time you revert to the other way!

          Plus, you never know how third party tools may call other exes. One day or another it'll blow.

          Anyway, as far as I'm concerned: I'm really eager to test J2.0, but this is a no-go...

          Christophe Carpentier added a comment - Still present in 2.0-rc. jglick and vakulenko_alex , I don't understand why this issue is a blocker, and yet it doesn't seem to hinder the promotion of the version from beta to RC. And please don't tell us we can work around it by changing the way our bats are called: I'm not going to change all my Ant scripts, then change again the next time you revert to the other way! Plus, you never know how third party tools may call other exes. One day or another it'll blow. Anyway, as far as I'm concerned: I'm really eager to test J2.0, but this is a no-go...

          I've run some additionnal tests, the AnsiColorBuildWrapper may be at fault.
          Thus, this simple ant file sufices:

          <?xml version="1.0"?>
          <project name="Minimal JENKINS-33456" basedir="." default="build">
          	<target name="build">
          		<fail/>
          	</target>
          </project>
          

          I'll disable the color ansi codes for now, but hey.

          Christophe Carpentier added a comment - I've run some additionnal tests, the AnsiColorBuildWrapper may be at fault. Thus, this simple ant file sufices: <?xml version= "1.0" ?> <project name= "Minimal JENKINS-33456" basedir= "." default= "build" > <target name= "build" > <fail/> </target> </project> I'll disable the color ansi codes for now, but hey.

          Disabling the wrapper did no good. I've put all our current ant tasks in a script and tried it, it freeze on success too.
          I think my particular issue might be closer to JENKINS-33164.

          Christophe Carpentier added a comment - Disabling the wrapper did no good. I've put all our current ant tasks in a script and tried it, it freeze on success too. I think my particular issue might be closer to JENKINS-33164 .

            jglick Jesse Glick
            vakulenko_alex Aleksei Vakulenko
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: