Skip to content

Conversation

@elfranne
Copy link

@elfranne elfranne commented Jul 9, 2021

General

  • Update Changelog following the conventions laid out here

  • Update README with any necessary configuration snippets

  • RuboCop passes

  • Existing tests pass

Purpose

Errors like this:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find resource 'Exec[systemctl-daemon-reload]' for relationship on 'Service[oxidized]' on node node.domain.com

do not appear in the summary file because it never manage to get the catalog, see https://tickets.puppetlabs.com/browse/PUP-9396 and https://tickets.puppetlabs.com/browse/PUP-2089

But they appear in last_run_report.yaml:

sudo head -n 13 /opt/puppetlabs/puppet/cache/state/last_run_report.yaml
--- !ruby/object:Puppet::Transaction::Report
host: node.domain.com
time: '2021-07-09T11:42:36.256429184+00:00'
configuration_version:
transaction_uuid: [long string]
report_format: 11
puppet_version: 6.23.0
status: failed
transaction_completed: false
noop: false
noop_pending: false
environment: production
logs:

The check is not using the YAML library (loads the entire file into memory) because the report file can be quite big. So only the 13 first line are used.

Known Compatibility Issues

None

@elfranne
Copy link
Author

This addition require sudo to open the report file. It requires to add /usr/bin/head -n 13 /opt/puppetlabs/puppet/cache/state/last_run_report.yaml (for Puppet6 and earlier version) to the sudoers file.

Would love to have some feedback on the new sudo requirement:

  • add a breaking change notice ?
  • do not enable the check by default ?
  • split into another check ? ( kinda breaks the idea of a check puppet errors for me )
  • create a check-puppet-errors-v2.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant