I ran puppet apply and got an error. Is there any way that I can get more details on this error?

err: /Stage[main]/XX/Service[xx]: Failed to call refresh: Could not restart Service[xx]: Execution of '/etc/init.d/xx restart' returned 1: at /etc/puppet/manifests/xx/xx.pp:20

  • 1
    Does the init script return an exit code of 0 when you manually run the /etc/init.d/xx restart that Puppet is attempting? – Shane Madden Oct 17 '12 at 5:18
  • I can't reproduce the error at the moment. Are there no logs and the solution is to just try it manually and see what the error is? – benmccann Oct 17 '12 at 5:27
  • What you've got pretty much is the log - the fact that it got a non-zero status code is about all the info that Puppet has. Are you sure it's getting a good response code? Run /etc/init.d/xx restart; echo $? and see what the output looks like. – Shane Madden Oct 17 '12 at 5:33
  • Well presumably /etc/init.d/xx restart produced some error which puppet swallowed. That restart call is working fine for me now, but it's still good to know if I run into a service failing to start in the future that I need to try it manually to see what the error is. I'd accept your answer as an answer except it's a comment, so I can't :-) – benmccann Oct 17 '12 at 6:11

Use puppet apply --debug to get more output. With puppet apply there is no logfile at all but you can redirect the output with --logdest to a file

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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