Catalog failures outside of individual resources

27 views
Skip to first unread message

Branan Riley

unread,
Jul 21, 2015, 3:37:09 PM7/21/15
to puppe...@googlegroups.com
<This is email 1/2 inspired by PUP-4813>

Currently, if a catalog fails after some resources have been applied
but ouside of an individual resource, the error handling is something
like this:

* puppet agent with --detailed-exitcodes will return '1'. This
  abandons any actual detailed exit information

* The report will not be marked as failed. This is pretty obviously bad.

* No further resources are applied.

I've confirmed this will happen when a prefetch fails, and it looks as
though it will also occur when an eval_generate fails. There are
probably others.

For the prefetch case I'd like to see improved error handling baked
in, and will be sending out another email shortly. For the more
general case, I think the following two small changes are worthwhile:

* Add 3, 5, and 7 to --detailed-exitcodes. This will indicate that the
  entire catalog was aborted, but that resource changes or failures
  had also occured. It's important to note that this will ONLY
  introduce new exitcodes in the case where we'd currently return
  1. Any case that would return a 2, 4, or 6 would still do so.

* Make sure the report is marked as failed anytime the agent would
  exit with one of those exit codes

I feeel like these are pretty straightforward, but I figured there
would be lots of tools that make assumptions about our reporting and
wanted to get a bit of feedback before moving forward.

Thanks,
Branan Riley
Puppet Labs Software Engineer

Kylo Ginsberg

unread,
Jul 22, 2015, 1:37:26 PM7/22/15
to puppe...@googlegroups.com
+1 on this.

Re assumptions, the worst I could imagine is someone not realizing that detailed-exitcodes returns a *bitmask* and checking for just 1 (as opposed to return_value & 1). But that would be a bug in their code and would be trivially fixed.

While we're at it, we should clarify the docs re --detailed-exitcodes. It's *implemented* as a bitmask but the docs don't mention that and instead say what 2, 4, and 6 means.

Kylo


Thanks,
Branan Riley
Puppet Labs Software Engineer

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CADWDnr%3D_suvrcgCsr%2BhJVG71NiJCab1bs6jQSm76w4CFMmsxgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Kylo Ginsberg | ky...@puppetlabs.com | irc: kylo | twitter: @kylog

PuppetConf 2015 is coming to Portland, Oregon! Join us October 5-9.
Register now to take advantage of the Early Bird discount save $249!

Reply all
Reply to author
Forward
0 new messages