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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Not A Defect
    • 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

    Description

      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.

       

      Attachments

        Activity

          egonzalez Eduardo Gonzalez created issue -
          egonzalez Eduardo Gonzalez made changes -
          Field Original Value New Value
          Component/s core [ 15593 ]
          egonzalez Eduardo Gonzalez made changes -
          Description 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.

           
          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.

           
          danielbeck Daniel Beck made changes -
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Resolved [ 5 ]

          People

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

            Dates

              Created:
              Updated:
              Resolved: