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

Workflow shell step ERROR: script returned exit code -1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: docker-workflow-plugin
    • Labels:
      None
    • Environment:
      jenkins 2.11, gerrit-trigger 2.21.1, docker-workflow 1.5, pipeline 2.2
    • Similar Issues:

      Description

      So I'm trying to use workflow and gerrit-trigger plugins together. But I'm getting script returned exit code -1. I've checked, and it's not 'git fetch' network related issue or anything like that. Any command I run through 'sh' which make some output delay like, git fetch or clone, or whatever - gives me -1 exit code. Groovy script is same like in gerrit-trigger example from https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger
      My log samples below:

      Retriggered by user admin for Gerrit: https://url/gerrit/73010 in silent mode.
      [Pipeline] node
      Running on master in /var/jenkins_home/workspace/pipeline-docker-test
      [Pipeline] {
      [Pipeline] withDockerServer
      [Pipeline] {
      [Pipeline] sh
      [pipeline-docker-test] Running shell script
      + docker inspect -f . dockers.local:5000/image:latest
      .
      [Pipeline] withDockerContainer
      $ docker run -t -d -u 1000:1000 -w /var/jenkins_home/workspace/pipeline-docker-test -v /var/jenkins_home/workspace/pipeline-docker-test:/var/jenkins_home/workspace/pipeline-docker-test:rw -v /var/jenkins_home/workspace/pipeline-docker-test@tmp:/var/jenkins_home/workspace/pipeline-docker-test@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** dockers.local:5000/image:latest cat
      [Pipeline] {
      [Pipeline] stage (cloning repo)
      Entering stage cloning repo
      Proceeding
      [Pipeline] git
       > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
       > git config remote.origin.url ssh://url:29418/project # timeout=10
      Fetching upstream changes from ssh://url:29418/project
       > git --version # timeout=10
       > git -c core.askpass=true fetch --tags --progress ssh://url:29418/project +refs/heads/*:refs/remotes/origin/*
       > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
       > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
      Checking out Revision 82beb7889ae2fea7a35a59575bb849c881302eec (refs/remotes/origin/master)
       > git config core.sparsecheckout # timeout=10
       > git checkout -f 82beb7889ae2fea7a35a59575bb849c881302eec # timeout=10
       > git branch -a -v --no-abbrev # timeout=10
       > git branch -D master # timeout=10
       > git checkout -b master 82beb7889ae2fea7a35a59575bb849c881302eec
       > git rev-list 82beb7889ae2fea7a35a59575bb849c881302eec # timeout=10
      [Pipeline] stage (Checkout patchset)
      Entering stage Checkout patchset
      Proceeding
      [Pipeline] sh
      [pipeline-docker-test] Running shell script
      + git fetch origin refs/changes/10/73010/1:change-73010-1
      [Pipeline] }
      $ docker stop d3499aacbbef9d2acbb0e9cdbac51c0ea620e91b9893d46ceda49d5344357c61
      $ docker rm -f d3499aacbbef9d2acbb0e9cdbac51c0ea620e91b9893d46ceda49d5344357c61
      [Pipeline] // withDockerContainer
      [Pipeline] }
      [Pipeline] // withDockerServer
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: script returned exit code -1
      Finished: FAILURE
      

      Example below. I made 3 'sh' steps:

      sh 'pwd'
      sh 'sleep 1'
      sh 'uname'
      

      and log:

      [Pipeline] {
      [Pipeline] sh
      [pipeline-docker-test] Running shell script
      
      + pwd
      /var/jenkins_home/workspace/pipeline-docker-test
      [Pipeline] sh
      
      [pipeline-docker-test] Running shell script
      
      + sleep 1
      
      [Pipeline] }
      $ docker stop 93ea34143c0a9c7e28b6e580d620f33bcc8f0e0081e7885ea63ef9ad0d1fc57e
      $ docker rm -f 93ea34143c0a9c7e28b6e580d620f33bcc8f0e0081e7885ea63ef9ad0d1fc57e
      [Pipeline] // withDockerContainer
      [Pipeline] }
      [Pipeline] // withDockerServer
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: script returned exit code -1
      Finished: FAILURE
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              penszo zbigniew jasinski
              Votes:
              6 Vote for this issue
              Watchers:
              20 Start watching this issue

                Dates

                Created:
                Updated: