• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • durable-task-plugin
    • None

      Jenkinsfile:

      pipeline {
          agent any
          options {
              timeout(time: 1, unit: 'HOURS')
          }
          stages {
              stage('Starting') {
                  steps {
                      echo "Running ${env.JOB_NAME} - ${env.BUILD_ID}"
                  }
              }
              stage('Checkout') {
                  steps {
                      echo 'Checkout..'
                      checkout scm
                  }
              }
              stage('Build') {
                  steps {
                      powershell 'Write-Output "Hello, World!"'
                  }
              }
          }
      }
      

      Here's the console output:

      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (Build)
      [Pipeline] powershell
      [devel] Running PowerShell script
      

      And it just times out after an hour.

      Powershell tasks were working last week. The change may have coincided with a Jenkins update from 2.73.2 to 2.73.3, but I reverting back to 2.73.2 has not resolved the issue.

          [JENKINS-48175] Powershell 'Hello World' Task Hangs

          Dan Black added a comment -

          Reverting to 1.15 also solved my issue. Thanks jameswithers

          Dan Black added a comment - Reverting to 1.15 also solved my issue. Thanks jameswithers

          Cody Konior added a comment - - edited

          I had the same problem - it really broke my main Jenkins instance with all the pipeline powershell steps hanging. Reverting to 1.15 fixed it.

          Cody Konior added a comment - - edited I had the same problem - it really broke my main Jenkins instance with all the pipeline powershell steps hanging. Reverting to 1.15 fixed it.

          I had this problem. But it only occurred with jobs that had a space in their name. This was on Windows 10 with Powershell 5.1. Reverting to 1.15 fixed it.

          Charles Bozarth added a comment - I had this problem. But it only occurred with jobs that had a space in their name. This was on Windows 10 with Powershell 5.1. Reverting to 1.15 fixed it.

          Scott Selberg added a comment -

          This just stumped me for a day.  Rolling back to 1.15 fixed the issue.  Thanks reporters!

          Scott Selberg added a comment - This just stumped me for a day.  Rolling back to 1.15 fixed the issue.  Thanks reporters!

          Chris Stylianou added a comment - FYI issue is being fixed here: https://issues.jenkins-ci.org/browse/JENKINS-46496?focusedCommentId=321090&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-321090

          Jesse Glick added a comment -

          Possibly duplicate.

          Jesse Glick added a comment - Possibly duplicate.

          James Withers added a comment -

          This issue is resolved with 1.18. Cheers

          James Withers added a comment - This issue is resolved with 1.18. Cheers

          Dmitry Bondarenko added a comment - - edited

          This issue still exists in Jenkins 2.107.2.

          Default installation of Jenkins + install default PowerShell plugin + create simple "MyTest01" job with mentioned pipline - you got a PowerShell hang!

          It looks like PowerShell does not work at all in Jenkins 2.107.2.

          Also bad thing - it cannot abort normally, it says:

          Sending interrupt signal to process
          After 10s process did not stop
          

          But the "powershell.exe" process is not exists at all! So, looks like Jenkins is not able to recognize that process is no longer exists after task started! :-\

          And the worst thing - I even cannot see anything in log files. So, do not see - what could be wrong with it?

          Note: it seems this is not related to space in name or in path. Because as an experiment I changed workspace path to "D:\jenkins" and got exactly the same result - PowerShell hangs.

          Note: OS = Win 2008 R2

          PS C:\Users\alta>  $PSVersionTable
          Name                           Value
          ----                           -----
          CLRVersion                     2.0.50727.8762
          BuildVersion                   6.1.7601.17514
          PSVersion                      2.0
          WSManStackVersion              2.0
          PSCompatibleVersions           {1.0, 2.0}
          SerializationVersion           1.1.0.1
          PSRemotingProtocolVersion      2.1
          

          Dmitry Bondarenko added a comment - - edited This issue still exists in Jenkins 2.107.2. Default installation of Jenkins + install default PowerShell plugin + create simple "MyTest01" job with mentioned pipline - you got a PowerShell hang! It looks like PowerShell does not work at all in Jenkins 2.107.2. Also bad thing - it cannot abort normally, it says: Sending interrupt signal to process After 10s process did not stop But the "powershell.exe" process is not exists at all! So, looks like Jenkins is not able to recognize that process is no longer exists after task started! :-\ And the worst thing - I even cannot see anything in log files. So, do not see - what could be wrong with it? Note: it seems this is not related to space in name or in path. Because as an experiment I changed workspace path to "D:\jenkins" and got exactly the same result - PowerShell hangs. Note: OS = Win 2008 R2 PS C:\Users\alta> $PSVersionTable Name Value ---- ----- CLRVersion 2.0.50727.8762 BuildVersion 6.1.7601.17514 PSVersion 2.0 WSManStackVersion 2.0 PSCompatibleVersions {1.0, 2.0} SerializationVersion 1.1.0.1 PSRemotingProtocolVersion 2.1

          Joakim Plate added a comment -

          Ran into the same issue on 2.107.2. Just had a block like the following

           

          powershell('''
              Import-Module ....
          ''')

           

          No output, just hangs.

          Name Value
          ---- -----
          CLRVersion 2.0.50727.8784
          BuildVersion 6.1.7601.17514
          PSVersion 2.0
          WSManStackVersion 2.0
          PSCompatibleVersions {1.0, 2.0}
          SerializationVersion 1.1.0.1
          PSRemotingProtocolVersion 2.1

           

          Joakim Plate added a comment - Ran into the same issue on 2.107.2. Just had a block like the following   powershell(''' Import-Module .... ''')   No output, just hangs. Name Value ---- ----- CLRVersion 2.0.50727.8784 BuildVersion 6.1.7601.17514 PSVersion 2.0 WSManStackVersion 2.0 PSCompatibleVersions {1.0, 2.0} SerializationVersion 1.1.0.1 PSRemotingProtocolVersion 2.1  

          Gao Jun added a comment -

          I have the same problem described above, but sometimes Jenkins job can finish, sometimes cannot.

          When I start a powershell script, if the Jenkins cannot finish, pipeline icon displayed as under processing.

          Jenkins Version: 2.89.3

          Gao Jun added a comment - I have the same problem described above, but sometimes Jenkins job can finish, sometimes cannot. When I start a powershell script, if the Jenkins cannot finish, pipeline icon displayed as under processing. Jenkins Version: 2.89.3

            Unassigned Unassigned
            hurricane766 Dan Black
            Votes:
            8 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: