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

Pipeline script bat command hanging in Windows 10 agent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • pipeline
    • Jenkins ver. 2.189, Windows 10 Pro ver. 1903, Linux master and Windows slave

      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.

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

              Created:
              Updated: