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

Pipeline: Job v2.11 breaks build with bat() command

XMLWordPrintable

      Hi there!

      We just upgraded our Pipeline:Job plugin from 2.10 to version 2.11. We're using the following pipeline script:

      node {
      
      stage('Prepare/Checkout') {
          dir('repo-master') {
              git credentialsId: 'secret_access', poll: false , url: 'ssh://git@company.url.com:7999/xxx/repo.git'
          }
          bat('del -f d:\\xxx\\yy.zip >nul 2>&1')
      }
      }
      

      Unfortunately since 2.11, we receive the following issue during build at the bat() call:

      ...
       > git.exe checkout -b master 3579a579a89ccee5892fbb94951f868020a9d4f7
       > git.exe rev-list 3579a579a89ccee5892fbb94951f868020a9d4f7 # timeout=10
      [Pipeline] }
      [Pipeline] // dir
      [Pipeline] bat
      [workspace] Running batch script
      'cmd' is not recognized as an internal or external command,
      operable program or batch file.
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: script returned exit code 9009
      Finished: FAILURE
      

      It looks like the cmd.exe is not found any more in the PATH. It is strange as the cmd is not moved anywhere, and also downgrading to version 2.10 "resolves" the problem. We did not yet try 2.12, as we still use Jenkins 2.46.2

      We did not test any other "external" tool but it seems git is found in the first step.

      Plugin list is attached.

      Thanks in advance!

            Unassigned Unassigned
            bpedro István Bede
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: