Issue #7728 has been updated by Daniel Pittman.

Assignee set to Daniel Pittman

So, this turns out to hide a deeper problem: we used to report information 
about what we *didn't* do, but that kind of fell off the radar in this change.  
The only reporting we now have is these whit-derived complaints.  To call this 
out, this manifest displays the problem:

<pre>
class foo {
  exec { "test": command => "/usr/bin/false" }

  notify { "before": before  => Exec["test"] }
  notify { "after":  require => Exec["test"] }
}

include foo
</pre>

In 2.6.8, demonstrating the old behaviour:
<pre>
info: Applying configuration version '1307408243'
notice: before
notice: /Stage[main]/Foo/Notify[before]/message: defined 'message' as 'before'
err: /Stage[main]/Foo/Exec[test]/returns: change from notrun to 0 failed: 
/usr/bin/false returned 1 instead of one of [0] at 
/Users/daniel/puppetlabs/puppet/tmp/test.pp:2
notice: /Stage[main]/Foo/Notify[after]: Dependency Exec[test] has failures: true
warning: /Stage[main]/Foo/Notify[after]: Skipping because of failed dependencies
notice: Finished catalog run in 0.14 seconds
</pre>

In the current 2.7rc branch, we get instead reports about the class, which are 
unclear:
<pre>
info: Applying configuration version '1307408712'
notice: before
notice: /Stage[main]/Foo/Notify[before]/message: defined 'message' as 'before'
err: /Stage[main]/Foo/Exec[test]/returns: change from notrun to 0 failed: 
/usr/bin/false returned 1 instead of one of [0] at 
/Users/daniel/puppetlabs/puppet/tmp/test.pp:2
notice: /Stage[main]/Foo/Notify[after]: Dependency Exec[test] has failures: true
warning: /Stage[main]/Foo/Notify[after]: Skipping because of failed dependencies
notice: Class[Foo]: Dependency Exec[test] has failures: true
warning: Class[Foo]: Skipping because of failed dependencies
notice: Stage[main]: Dependency Exec[test] has failures: true
warning: Stage[main]: Skipping because of failed dependencies
notice: Finished catalog run in 0.12 seconds
</pre>

In this version we report that the failure happened, and then that the class 
and stage were "skipped" because of failed dependencies.  This should, more 
properly, be reporting something like "the *REST* of Class[Foo] was skipped 
because of a failed contained resource", but actually conveys vital information.

In my current change, which is in my view entirely incorrect, we report this:
<pre>
info: Applying configuration version '1307408381'
notice: before
notice: /Stage[main]/Foo/Notify[before]/message: defined 'message' as 'before'
err: /Stage[main]/Foo/Exec[test]/returns: change from notrun to 0 failed: 
/usr/bin/false returned 1 instead of one of [0] at 
/Users/daniel/puppetlabs/puppet/tmp/test.pp:2
notice: Finished catalog run in 0.12 seconds
</pre>

That is, y'know, wrong.  We have noted one error, but have absolutely no 
information about the fact that the after notify didn't fire.  We ate the 
information about what happened completely.

I *think* the right fix for this is to customise the wording of the reports 
about whit objects, so they talk about "contained blah was skipped", or at 
least "the rest of class blah was skipped", but it isn't entirely clear what we 
can do, or how to extract the *really* interesting information, which is what 
exact things were skipped.

Additionally, I have only done pretty light-weight testing of this code.  It 
presently went as complex as the manifest you see; that is hardly pushing the 
boundaries of error reporting code.  We should probably consider at least 
cross-stage dependencies, or more complex include structures, with regards 
reporting these errors, and how they map.
----------------------------------------
Bug #7728: Resource failure leads to multiple, somewhat confusing warnings and 
notices
https://projects.puppetlabs.com/issues/7728

Author: Matt Robinson
Status: Accepted
Priority: Normal
Assignee: Daniel Pittman
Category: error reporting
Target version: 2.7.0
Affected Puppet version: 2.7.0rc3
Keywords: 
Branch: 


If a simple file resource fails.

    file { '/tmp/nonexistentdir/food':
    content => 'zen'
    }
you used to get a simple output like:

    err: /Stage[main]//File[/tmp/nonexistentdir/food]/ensure: change from 
absent to file failed: Could not set 'file on ensure: No such file or directory 
- /tmp/nonexistentdir/food.puppettmp_9317 at 
/Users/matthewrobinson/work/puppet/test.pp:3
    notice: Finished catalog run in 0.01 seconds

However, since commit:2a6c6cb8fabf82d2f2127c90db670c1a856427c5 you now get a 
lot more warnings and notices

    err: /Stage[main]//File[/tmp/nonexistentdir/food]/ensure: change from 
absent to file failed: Could not set 'file on ensure: No such file or directory 
- /tmp/nonexistentdir/food.puppettmp_2197 at 
/Users/matthewrobinson/work/puppet/test.pp:3
    notice: /tmp/nonexistentdir/food: Dependency File[/tmp/nonexistentdir/food] 
has failures: true
    warning: /tmp/nonexistentdir/food: Skipping because of failed dependencies
    notice: Class[Main]: Dependency File[/tmp/nonexistentdir/food] has 
failures: true
    warning: Class[Main]: Skipping because of failed dependencies
    notice: Stage[main]: Dependency File[/tmp/nonexistentdir/food] has 
failures: true
    warning: Stage[main]: Skipping because of failed dependencies

When I first saw that I was worried that other resources in the main Class or 
Stage might not work, but some brief testing shows that not to be the case.  
Getting 7 lines in the log output about a resource failure seems confusing 
compared to just getting 1 in the past.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to