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

puppet run status should be "failed" if there are failed generated resources

    Details

    • Type: Task
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.8.7, PUP 4.6.2
    • Fix Version/s: PUP 4.8.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Agent
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Some puppet types (notably "file" and "user") are capable of "generating" resources. For example, a managed directory file resource with `recurse => true` will "generate" resources of any subdirectories/files in that directory so that Puppet can apply management to them.

      Prior to this bug fix, if for some reason Puppet encountered an exception/issue while "generating" these resources (ie, if an unmanageable file such as a socket exists in a managed directory with recurse => true), this failure would be logged in the run report, but run report's overall status would still be considered successful (ie, a status of either `changed` or `unchanged`).

      In Puppet 4.8.0 and later, if Puppet fails to generate resources for any managed resource, this will result in a report status of `failed`.
      Show
      Some puppet types (notably "file" and "user") are capable of "generating" resources. For example, a managed directory file resource with `recurse => true` will "generate" resources of any subdirectories/files in that directory so that Puppet can apply management to them. Prior to this bug fix, if for some reason Puppet encountered an exception/issue while "generating" these resources (ie, if an unmanageable file such as a socket exists in a managed directory with recurse => true), this failure would be logged in the run report, but run report's overall status would still be considered successful (ie, a status of either `changed` or `unchanged`). In Puppet 4.8.0 and later, if Puppet fails to generate resources for any managed resource, this will result in a report status of `failed`.

      Description

      In support escalation PE-17793 the customer reports that puppet runs are showing up as successful in the console despite having failures in the reports log.

      The customer has generated resources that are failing, which are getting logged in the report as errors, but the overall run status is reported as successful (specifically, unchanged).

      The console reads the run status field to determine what to display - hence success.

      When generated resources fail to generate in `eval_generate`, we log the exception and don't generate anymore resources for that parent, but otherwise management of the parent resource is unaffected. In transaction::report::compute_status we don't take the exception log into account when determining the run status, and thus can consider a run successful even when generated resources failed.

      After discussion with Branan Riley, the proposal is to detect when any resource generation has failed (perhaps introspect the Puppet::Util::Log instances associated with the report for failures or some other way?) and consider the run failed if any are encountered.

      This won't affect any resource-specific report data, just the overall run status, but will have the effect of "correcting" the report viewing for the user.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                moses Moses Mendoza
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: