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

If a resource is triggered by a refresh, and it fails, puppet doesn't treat it as a failure

    XMLWordPrintable

    Details

    • Template:
    • Acceptance Criteria:
      Hide

      If a resource is triggered by a refresh, and it fails, puppet will flag the run as failed in the report.

      Show
      If a resource is triggered by a refresh, and it fails, puppet will flag the run as failed in the report.
    • Team:
      Agent
    • Story Points:
      3
    • Sprint:
      Agent 2017-06-14, Agent 2017-06-28
    • CS Priority:
      Reviewed
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Puppet will now report runs as failed when an exec resource fails to refresh. In the past, failures to restart would not flag the run as failed.
    • QA Risk Assessment:
      Automate
    • QA Risk Assessment Reason:
      We should add a test for this if we don't have one.

      Description

      This may be a dupe of #9237.

      I have a module (puppetlabs/postgresql) that has some resources that are only triggered via a refresh notification. In my case the resource is a custom ruby type, but I stole some of its 'refreshonly' implementation from the Exec type, so this may be simply a problem with the exec type rather than a more general puppet problem. Here's an example that shows the problem using exec:

          cprice@localhost ~/work/scratch $ puppet --version
          3.0.2-rc2
       
          cprice@localhost ~/work/scratch $ cat foo.pp 
          notify { "hi": } ~>
          exec { "/bin/this_command_does_not_exist":
             refreshonly => true,
          }
       
          cprice@localhost ~/work/scratch $ puppet apply ./foo.pp
          No LSB modules are available.
          No LSB modules are available.
          Notice: hi
          Notice: /Stage[main]//Notify[hi]/message: defined 'message' as 'hi'
          Error: /Stage[main]//Exec[/bin/this_command_does_not_exist]: Failed to call refresh: Could not find command '/bin/this_command_does_not_exist'                                          
          Error: /Stage[main]//Exec[/bin/this_command_does_not_exist]: Could not find command '/bin/this_command_does_not_exist'                                                                  
          Notice: Finished catalog run in 0.18 seconds
          cprice@localhost ~/work/scratch $ echo $?
          0
          cprice@localhost ~/work/scratch $
      

      This has apparently been masking a legitimate bug in my module for several months now.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              redmine.exporter redmine.exporter
              QA Contact:
              Narmadha Perumal
              Votes:
              7 Vote for this issue
              Watchers:
              20 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support