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

build marks as failure on "execute shell" exit status 0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • buildresulttrigger, core
    • master: centos 7 + java (openjdk) 1.8.0_151 + jenkins 2.46.3 (plugins up to date as of 2017-11-19)
      slave: ubuntu 14 LTS + java (oracle) 1.8.0_151

      I have a matrix based job where some of the jobs are marked as failure even thought the shell steps exits with 0 code.

      These are the last lines of the output console when the job fails.
      {{ + exitcode=0}}
      {{ + exit 0}}
      {{ ++ '[' 1 = 1 ']'}}
      {{ ++ '[' -x /usr/bin/clear_console ']'}}
      {{ ++ /usr/bin/clear_console -q}}
      {{ Build step 'Execute shell' marked build as failure}}
      {{ Archiving artifacts}}
      {{ Sending e-mails to: xxxxx@xxxxx}}
      {{ Finished: FAILURE}}
      {{ The Execute Shell script last lines are:}}

      # if there were errors, exit code will be greater than zero.
      # and the build will fail.
      exitcode=$(wc -c stderr.out | cut -f 1 -d ' ')
      exit $exitcode

       

       

      The jobs that succeed have an output like this:
      {{ + exitcode=0}}
      {{ + exit 0}}
      {{ ++ '[' 2 = 1 ']'}}
      {{ Archiving artifacts}}
      {{ Sending e-mails to: xxxxx@xxxxx}}
      {{ Finished: SUCCESS}}
      {{  }}

       This issue occurs with no apparent reason.

       

            gbois Gregory Boissinot
            egonzalez Eduardo Gonzalez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: