Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #13701] Calling private method "Puppet.settings.preferred_run_mode=" in facter/icinga2_puppet.rb breaks Puppet master #159

Closed
icinga-migration opened this issue Dec 20, 2016 · 3 comments
Labels
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/13701

Created by antaflos on 2016-12-20 12:31:59 +00:00

Assignee: (none)
Status: Closed (closed on 2016-12-28 12:38:39 +00:00)
Target Version: v0.7.1
Last Update: 2016-12-28 12:38:39 +00:00 (in Redmine)


A Puppet master that is also monitored by Icinga using the puppet-icinga2-rewrite module breaks badly when the facts from icinga2_puppet.rb are loaded. This is caused by calling the private method Puppet.settings.preferred_run_mode= :agent.

Running Puppet 3.8.7 on both master and agent nodes.

Observe the Puppet agent run on an affected Puppet master:

root@puppet01 [~] # puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Permission denied - /var/lib/puppet/client_yaml/facts
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

root@puppet01 [~] # puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload puppet/indirector/catalog/active_record: uninitialized constant ActiveRecord
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Puppet agents running against that Puppet master won't work either because the Puppet master cannot compile catalogs any more.

As documented in https://github.com/puppetlabs/puppet/blob/master/lib/puppet/settings.rb#L507-L512 the preferred_run_mode method is private and should never be called externally.

The problem is easily fixed by removing the problematic line from icinga2_puppet.rb and requiring puppet instead of facter. See the puppetlabs-puppet_agent module for reference. It also provides Puppet settings as facts, and does so without calling private methods: https://github.com/puppetlabs/puppetlabs-puppet\_agent/blob/master/lib/facter/settings.rb

I have created a pull request in #29 to fix this.

@icinga-migration
Copy link
Author

Updated by bsheqa on 2016-12-20 12:52:58 +00:00

  • Target Version set to v0.8.0

@icinga-migration
Copy link
Author

Updated by lbetz on 2016-12-27 20:25:05 +00:00

  • Target Version changed from v0.8.0 to v0.7.1

@icinga-migration
Copy link
Author

Updated by bsheqa on 2016-12-28 12:38:39 +00:00

  • Status changed from New to Closed
  • Done % changed from 0 to 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant