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

Pipeline plugin sh script returned exit code -1 on windows node after a short while

XMLWordPrintable

      I've got many nodes running on different Linux distribution and also few windows nodes running with SSH slaves and Cygwin (https://wiki.jenkins-ci.org/display/JENKINS/SSH+slaves+and+Cygwin)

      Using the following pipeline script:

      _node('linuxHost') {
      stage('linuxHost linux')

      { sh '''sleep 30''' }

      }
      node('windowsHost') {
      stage('windowsHost cygwin')

      { bat 'sleep 30' sh '''sleep 30''' }

      }_

      On my windows node I always got an error "ERROR: script returned exit code -1" if my script execution time is greater than about 250ms no matter what the command content is (that's why I'm using a basic sleep for this example). I've got the exact same behavior for all of my windows nodes.

      Here are the execution logs:
      _Started by user Administrateur Jenkins
      [Pipeline] node
      Running on linuxHost in /var/jenkins_home/workspace/Unstable/TestShInPipeline
      [Pipeline] {
      [Pipeline] stage
      [Pipeline]

      { (linuxHost linux) [Pipeline] sh [TestShInPipeline] Running shell script + sleep 30 [Pipeline] }

      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] node
      Running on windowsHost in C:/Users/localuser/jenkins_home/workspace/Unstable/TestShInPipeline
      [Pipeline] {
      [Pipeline] stage
      [Pipeline]

      { (windowsHost cygwin) [Pipeline] bat [C:/Users/localuser/jenkins_home/workspace/Unstable/TestShInPipeline] Running batch script C:\Users\localuser\jenkins_home\workspace\Unstable\TestShInPipeline>sleep 30 [Pipeline] sh [TestShInPipeline] Running shell script + sleep 30 [Pipeline] }

      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: script returned exit code -1
      Finished: FAILURE_

      May be related to JENKINS-32017 ?
      It works fine using the same node and the "Execute Shell" build step in a freestyle project.

            Unassigned Unassigned
            bdesvages Benoît Desvages
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: