When deploying maas-infra rev 9 on jammy with --config nagios_check_pacemaker=true and relating it to nrpe, Ithe units got stuck in "hook failed: "nrpe-external-master-relation-joined" for nrpe-maas-infra:nrpe-external-master"
Debug logs shows:
unit-infra-node-0: 08:02:27 INFO unit.infra-node/0.juju-log Reactive main running for hook config-changed
unit-infra-node-0: 08:02:27 INFO unit.infra-node/0.juju-log Initializing Snap Layer
unit-infra-node-0: 08:02:27 INFO unit.infra-node/0.juju-log Invoking reactive handler: reactive/infra_node.py:29:do_config
unit-infra-node-0: 08:02:27 INFO unit.infra-node/0.juju-log Invoking reactive handler: reactive/infra_node.py:12:update_nrpe_config
unit-infra-node-0: 08:02:27 INFO unit.infra-node/0.juju-log Installing ['python-dbus', 'libmonitoring-plugin-perl'] with options: ['--option=Dpkg::Options::=--force-confold']
unit-infra-node-0: 08:02:27 WARNING unit.infra-node/0.config-changed E: Package 'python-dbus' has no installation candidate
unit-infra-node-0: 08:02:27 INFO unit.infra-node/0.juju-log Setting charm primary status True
unit-infra-node-0: 08:02:27 INFO unit.infra-node/0.juju-log Running create_nrpe_checks
unit-infra-node-0: 08:02:27 INFO unit.infra-node/0.juju-log Deployed /usr/local/lib/nagios/plugins
unit-infra-node-0: 08:02:27 ERROR unit.infra-node/0.juju-log Hook error:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-infra-node-0/.venv/lib/python3.10/site-packages/charms/reactive/__init__.py", line 74, in main
bus.dispatch(restricted=restricted_mode)
File "/var/lib/juju/agents/unit-infra-node-0/.venv/lib/python3.10/site-packages/charms/reactive/bus.py", line 390, in dispatch
_invoke(other_handlers)
File "/var/lib/juju/agents/unit-infra-node-0/.venv/lib/python3.10/site-packages/charms/reactive/bus.py", line 359, in _invoke
handler.invoke()
File "/var/lib/juju/agents/unit-infra-node-0/.venv/lib/python3.10/site-packages/charms/reactive/bus.py", line 181, in invoke
self._action(*args)
File "/var/lib/juju/agents/unit-infra-node-0/charm/reactive/infra_node.py", line 24, in update_nrpe_config
helper.create_nrpe_checks(nrpe_setup, hostname, current_unit)
File "/var/lib/juju/agents/unit-infra-node-0/charm/lib/lib_infra_node.py", line 87, in create_nrpe_checks
self.add_nrpe_pacemaker(nrpe_setup, hostname)
File "/var/lib/juju/agents/unit-infra-node-0/charm/lib/lib_infra_node.py", line 45, in add_nrpe_pacemaker
nrpe_setup.remove_check(*ring_check)
File "/var/lib/juju/agents/unit-infra-node-0/.venv/lib/python3.10/site-packages/charmhelpers/contrib/charmsupport/nrpe.py", line 299, in remove_check
raise ValueError('shortname of check must be specified')
ValueError: shortname of check must be specified
after switching nagios_check_pacemaker to false, the error is gone, but comes back once I activate it again.
This is probably related to bug 2011836. We should ignore option nagios_ check_pacemaker in Jammy and above.