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

Powershell 'Hello World' Task Hangs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: durable-task-plugin
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Possibly duplicate.

            Show
            jglick Jesse Glick added a comment - Possibly duplicate.
            Hide
            jameswithers James Withers added a comment -

            This issue is resolved with 1.18. Cheers

            Show
            jameswithers James Withers added a comment - This issue is resolved with 1.18. Cheers
            Hide
            dmitrybond 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
            
            Show
            dmitrybond 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
            Hide
            joakimplateqrtech 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

             

            Show
            joakimplateqrtech 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  
            Hide
            gaojun200233 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

            Show
            gaojun200233 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

              People

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

                Dates

                Created:
                Updated: