Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 10 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


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.