fail on first error. don't continue doing stuff

588 views
Skip to first unread message

Alexander Gray II

unread,
Mar 18, 2014, 9:03:38 PM3/18/14
to puppet...@googlegroups.com
I have weird scenario:
When I run puppet for the very first time, it always fails, but when I re-run puppet on that machine, it always passes.
I must have some obscure dependency issue somewhere and I'm trying to track it down.

Something *must* be occurring after the first error (puppet continues to run after that first error), but I would like to stop puppet the moment it encounters that error so that I can snoop around that machine.

Is there anyway for puppet to exit the moment it encounters an error?

Thanks!

Felix Frank

unread,
Apr 16, 2014, 1:17:27 PM4/16/14
to puppet...@googlegroups.com
How does this failure manifest itself then?

Have you scrutinized the agent's log to get to the bottom of it?

jcbollinger

unread,
Apr 16, 2014, 6:28:03 PM4/16/14
to puppet...@googlegroups.com


On Tuesday, March 18, 2014 4:03:38 PM UTC-5, Alexander Gray II wrote:
I have weird scenario:
When I run puppet for the very first time, it always fails, but when I re-run puppet on that machine, it always passes.
I must have some obscure dependency issue somewhere and I'm trying to track it down.

Something *must* be occurring after the first error (puppet continues to run after that first error), but I would like to stop puppet the moment it encounters that error so that I can snoop around that machine.



This kind of problem often arises when you are using Puppet to install software that it needs to use for other configuration tasks.  Sometimes (and moreso in the most recent versions of Puppet) you can fix the problem by declaring resource relationships the require Puppet to sync the software (typically by applying a Package resource) before it tries to apply whatever resource it is that otherwise fails the first time.

 
Is there anyway for puppet to exit the moment it encounters an error?


Not as far as I am aware.  Puppet is designed specifically to apply as much of the nodes configuration as it can.  The log will tell you the order in which resources were applied, and which one(s) failed.  It will give that and more to you in great detail if you enable verbose logging (--verbose flag).


John

Alexander Gray II

unread,
Apr 18, 2014, 7:05:42 PM4/18/14
to puppet...@googlegroups.com
Thanks guys for looking into this.
I never got to the root cause of this, but the failure was with Augeas trying to set some value in an xml file.
I tried all levels of debug and verbosity and manually trying to see why Augeas would fail, even manually running Augeas on the file would pass.
I wanted puppet to stop immediately on error so that I could manually go through Augeas and sniff around, but since puppet does a million-and-one things after the error, and it's unreproducible after puppet runs.
To make a long story short, it looks like there is no way to halt puppet on error, and I could not figure out what was causing Augeas to fail, so i just worked around Augeas by not even using it.

Thanks,
Alex

Gregory Orange

unread,
Apr 22, 2014, 1:35:59 AM4/22/14
to puppet...@googlegroups.com
On 19/04/14 03:05, Alexander Gray II wrote:
> I wanted puppet to stop immediately on error so that I could manually go
> through Augeas and sniff around, but since puppet does a million-and-one
> things after the error, and it's unreproducible after puppet runs.

I sometimes want that behaviour, but haven't found it. When I'm really
keen to narrow down what's happening, I change the node (or role)
definition and remove most of what it does, trying to get a 'full'
Puppet run to still result in the failure but without a lot of what else
is going on.
Reply all
Reply to author
Forward
0 new messages