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

Powershell script will hang in pipeline

    XMLWordPrintable

    Details

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

      Description

      I'm a game developer using Unity.

      My main purpose of using Jenkins is to do some resources check / build / automated test daily.

      I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

      The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

      Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

      Since this is not a bug that appears every time, I really have no idea how to fix it.

       

      This is the stage that will hang

       

      stage('Build'){
          options{
              timeout(time: 60, unit: "MINUTES")
          }
          steps{
              echo "build start..."
              pwsh("&\"${ScriptPath}/Build.ps1\"")
              echo "build finish"
          }
      }
      

       This is the content inside Build.ps1

      # prepare befor build... 
      Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait
      # generate report after build...

       I added some echo before and after build so I'm sure when it hangs, the content after build is never executed. And the build is always successful(no error in Unity's log and the result package can be found).

       

       

       

        Attachments

          Activity

          axelhu Axel Hu created issue -
          axelhu Axel Hu made changes -
          Field Original Value New Value
          Description I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.
          I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

           
          axelhu Axel Hu made changes -
          Description I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

           
          I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           

           

           
          axelhu Axel Hu made changes -
          Description I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           

           

           
          I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           This is the content inside Build.ps1

           
          {code:java}
           # prepare befor build...

           Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod Jedi.CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait

           # generate report after build...
          {code}
           

           

           

           
          axelhu Axel Hu made changes -
          Description I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           This is the content inside Build.ps1

           
          {code:java}
           # prepare befor build...

           Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod Jedi.CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait

           # generate report after build...
          {code}
           

           

           

           
          I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           This is the content inside Build.ps1

           ~~
          {noformat}
          # prepare befor build... Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod Jedi.CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait
          # generate report after build...{noformat}
           

           

           

           
          axelhu Axel Hu made changes -
          Description I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           This is the content inside Build.ps1

           ~~
          {noformat}
          # prepare befor build... Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod Jedi.CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait
          # generate report after build...{noformat}
           

           

           

           
          I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           This is the content inside Build.ps1
          {noformat}
          # prepare befor build...
          Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod Jedi.CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait
          # generate report after build...{noformat}
           

           

           

           
          axelhu Axel Hu made changes -
          Description I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           This is the content inside Build.ps1
          {noformat}
          # prepare befor build...
          Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod Jedi.CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait
          # generate report after build...{noformat}
           

           

           

           
          I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           This is the content inside Build.ps1
          {noformat}
          # prepare befor build...
          Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod Jedi.CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait
          # generate report after build...{noformat}
           I added some echo before and after build so I'm sure when it hangs, the content after build is never executed. And the build is always successful(no error in Unity's log and the result package can be found).

           

           

           
          axelhu Axel Hu made changes -
          Description I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           This is the content inside Build.ps1
          {noformat}
          # prepare befor build...
          Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod Jedi.CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait
          # generate report after build...{noformat}
           I added some echo before and after build so I'm sure when it hangs, the content after build is never executed. And the build is always successful(no error in Unity's log and the result package can be found).

           

           

           
          I'm a game developer using Unity.

          My main purpose of using Jenkins is to do some resources check / build / automated test daily.

          I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

          The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

          Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

          Since this is not a bug that appears every time, I really have no idea how to fix it.

           

          This is the stage that will hang

           
          {code:java}
          stage('Build'){
              options{
                  timeout(time: 60, unit: "MINUTES")
              }
              steps{
                  echo "build start..."
                  pwsh("&\"${ScriptPath}/Build.ps1\"")
                  echo "build finish"
              }
          }
          {code}
           This is the content inside Build.ps1
          {noformat}
          # prepare befor build...
          Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait
          # generate report after build...{noformat}
           I added some echo before and after build so I'm sure when it hangs, the content after build is never executed. And the build is always successful(no error in Unity's log and the result package can be found).

           

           

           

            People

            Assignee:
            froque Filipe Roque
            Reporter:
            axelhu Axel Hu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: