Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When using Puppet, I get error messages like

returned 1 instead of one of [0]

Is there a way to output/get the actual error message?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Sounds like you're dealing with an exec resource, right?

By default, the output of the command is logged by puppet in cases (like this one) that the command has failed - see the logoutput setting of the exec resource type.

If you're not seeing any other error output, it's possible the command simply didn't provide any (completely silent in both stdout and stderr); you may need to look into setting the application you're running into a more verbose mode.

Some applications return a non-zero exit code on success (though your 1 is almost certainly a failure of some kind). To account for this, you can set returns to the set of exit codes that's expected on success; that's where the [0] in your error message comes from.

Setting this in your exec resource, for instance, would consider any of these three exit codes as a "successful" execution.

returns => [0, 2, 14]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.