Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-33164

Pipeline bat stuck on Windows Server 2012

    XMLWordPrintable

Details

    Description

      I have Jenkins slave nodes configured on Windows Server 2012 with a very simple pipeline script:

      node('js-win') {
      	stage 'Checkout'
      	checkout scm
      	stage 'Build'
      	bat 'dir'
      }
      

      At the end of the script, from the Console output, it would just spin and hang after listing all the files.

      Attachments

        Issue Links

          Activity

            jglick Jesse Glick added a comment -

            all plugins up to date (20/05/2016)

            I need more details than that. durable-task 1.10, with an important fix for Windows users, was released around that time. And it is driven by workflow-durable-task-step.

            jglick Jesse Glick added a comment - all plugins up to date (20/05/2016) I need more details than that. durable-task 1.10, with an important fix for Windows users, was released around that time. And it is driven by workflow-durable-task-step .
            jglick Jesse Glick added a comment -

            Tried again to reproduce on 2012 without success. Also checked stopping and restarting Jenkins as java -jar jenkins.war while

            node {
                bat 'ping -n 100 localhost'
            }
            

            was running, which worked fine. I did see that if you install Jenkins as a Windows service and use /safeRestart (not currently a GUI option), and the build is using a master executor, the restart itself kills the ping process (according to Task Manager), so upon resuming, the build will either hang (until you abort it and then “forcibly kill running steps”) or print

            Reply from ::1: time<1ms 
            Reply from ::1: time<1ms 
            Resuming build
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            ERROR: script returned exit code -1
            Finished: FAILURE
            

            since pending JENKINS-25053 Jenkins does not have a way of knowing that the process exited abnormally. This also seems to happen when using a JNLP slave installed as a service, which is more relevant (since running builds on the master is discouraged anyway). JENKINS-27617 would probably help.

            At any rate, issues with the actual process being inappropriately killed during restarts are not related to the far more fundamental problem reported here, which I am unable to reproduce.

            jglick Jesse Glick added a comment - Tried again to reproduce on 2012 without success. Also checked stopping and restarting Jenkins as java -jar jenkins.war while node { bat 'ping -n 100 localhost' } was running, which worked fine. I did see that if you install Jenkins as a Windows service and use /safeRestart (not currently a GUI option), and the build is using a master executor, the restart itself kills the ping process (according to Task Manager), so upon resuming, the build will either hang (until you abort it and then “forcibly kill running steps”) or print Reply from ::1: time<1ms Reply from ::1: time<1ms Resuming build [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: script returned exit code -1 Finished: FAILURE since pending JENKINS-25053 Jenkins does not have a way of knowing that the process exited abnormally. This also seems to happen when using a JNLP slave installed as a service, which is more relevant (since running builds on the master is discouraged anyway). JENKINS-27617 would probably help. At any rate, issues with the actual process being inappropriately killed during restarts are not related to the far more fundamental problem reported here, which I am unable to reproduce.

            I have had this happen when my job name contained å,ä or ö.

            thecopy Erik Jonsson Thorén added a comment - I have had this happen when my job name contained å,ä or ö.

            Is somebody looking at this issue? I am also experiencing the same problem on Windows 10 and Windows 7 whenever i run a program with Batch.

            esramirez Enrique Ramirez added a comment - Is somebody looking at this issue? I am also experiencing the same problem on Windows 10 and Windows 7 whenever i run a program with Batch.

            We also hit this constantly on Win10. In our case it seems like if pipeline is trying to delete a running process then it will just be stuck there indefinitely. I can understand the headache of deleting files in use in general on windows, but I would hope that the Pipeline side of things could give up in accordance with the timeout settings we provide. Instead it will hang forever until we do the 3 step abort of terminating in the console.

            rainwaj Justin Rainwater added a comment - We also hit this constantly on Win10. In our case it seems like if pipeline is trying to delete a running process then it will just be stuck there indefinitely. I can understand the headache of deleting files in use in general on windows, but I would hope that the Pipeline side of things could give up in accordance with the timeout settings we provide. Instead it will hang forever until we do the 3 step abort of terminating in the console.

            People

              jglick Jesse Glick
              mocsharp mocsharp
              Votes:
              24 Vote for this issue
              Watchers:
              35 Start watching this issue

              Dates

                Created:
                Updated: