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

Pipeline script bat command hanging in Windows 10 agent

    Details

    • Similar Issues:

      Description

      When I run the pipeline stage to execute 'electron-packager .' command, it hangs forever.

      My stage:

       

       stage("Electron package"){
                  steps{
                      script{
                          echo "Electron package"
                          timeout(time: 10, unit: 'MINUTES') { // timeout 
                          //sh '''
                          //    cat <<EOF > packager.bat
                          //    @echo off 
                          //    electron-packager . 
                          //    '''
                          //bat returnStdout: true, returnStatus: false, script: 'electron-packager . &'
                          //powershell "npm run package-win"
                          bat "electron-packager ."
                      //bat returnStatus: true, script: 'electron-packager ./'
                          //bat 'cmd.exe /c packager.bat'
                      //bat "electron-packager ./release-builds electron-app --platform=win32 --arch=x64 --overwrite --version-string.ProductName=\"MY Electron App\""
                          }
                      }
                  }
      

      As you can see the commented lines I tried several ways but it always just hangs.

      • Powershell
      • Execute bat file 

       

      No output or result about in the logs to see what happens and what is it waiting for. For me, it looks like a permission issue. So, I disabled UAC and the Jenkins agent is running as a Service. In earlier stages I also used 'bat' steps and it's all working fine.

        Attachments

          Activity

          Hide
          tkrisztiangyula Krisztián Gyula Tóth added a comment -

          As I thought the issue was related to some permission settings. I changed the Jenkins agent service Log on property from 'Local System account' to 'This account' option and I selected the same account what I use to log in the machine. The 'electron-packager .' command now executes and not hanging anymore.

           

          Show
          tkrisztiangyula Krisztián Gyula Tóth added a comment - As I thought the issue was related to some permission settings. I changed the Jenkins agent service Log on property from 'Local System account' to 'This account' option and I selected the same account what I use to log in the machine. The 'electron-packager .' command now executes and not hanging anymore.  

            People

            • Assignee:
              kohsuke Kohsuke Kawaguchi
              Reporter:
              tkrisztiangyula Krisztián Gyula Tóth
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: