Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-2754

Exit status is 0, even in the presence of errors, without --detailed-exitcodes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:
    • Team:
      Coremunity

      Description

      When an error is encountered while running either `puppet apply` or `puppet agent`, the program exits with status 0. If `--detailed-exitcodes` is used with `puppet agent`, the status is nonzero as expected. I would expect that "non-detailed exit codes" would still include 1 for the case of a failure to apply the catalog.

      You can recreate this with the following manifest:

      exec { 'false':
        command => '/bin/false',
      }
      

      Example run:

      marmida@monolith:~$ puppet apply fail_manifest.py 
      warning: Could not retrieve fact fqdn
      err: /Stage[main]//Exec[false]/returns: change from notrun to 0 failed: /bin/false returned 1 instead of one of [0] at /home/marmida/fail_manifest.py:3
      notice: Finished catalog run in 0.14 seconds
      marmida@monolith:~$ echo $?
      0
      marmida@monolith:~$ puppet apply fail_manifest.py --detailed-exitcodes
      warning: Could not retrieve fact fqdn
      err: /Stage[main]//Exec[false]/returns: change from notrun to 0 failed: /bin/false returned 1 instead of one of [0] at /home/marmida/fail_manifest.py:3
      notice: Finished catalog run in 0.13 seconds
      marmida@monolith:~$ echo $?
      4
      

      The same problems occur in `puppet agent`.

      I couldn't find another issue specific to the exit status, but I did notice it mentioned once here:
      http://projects.puppetlabs.com/issues/14458#note-6

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            redmine.exporter redmine.exporter
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support