Adding nrpe relation fails for nrpe-external-master-relation-{joined, changed}

Bug #1944546 reported by Diko Parvanov
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
NTP Charm
New
Undecided
Unassigned

Bug Description

Revision 47, affects focal and bionic.

unit-ntp-15: 09:28:42 ERROR unit.ntp/15.juju-log nrpe-external-master:22788: Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-ntp-15/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 74, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-ntp-15/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 379, in dispatch
    _invoke(hook_handlers)
  File "/var/lib/juju/agents/unit-ntp-15/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-ntp-15/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-ntp-15/charm/hooks/relations/nrpe-external-master/provides.py", line 16, in changed_nrpe
    self.set_state('{relation_name}.available')
  File "/var/lib/juju/agents/unit-ntp-15/.venv/lib/python3.6/site-packages/charms/reactive/relations.py", line 476, in set_state
    self.conversation(scope).set_state(state)
  File "/var/lib/juju/agents/unit-ntp-15/.venv/lib/python3.6/site-packages/charms/reactive/relations.py", line 716, in set_state
    if self.key not in value['conversations']:
TypeError: 'NoneType' object is not subscriptable

Workaround for this is to go into debug-hooks for the unit and run

charms.reactive set_state nrpe-external-master.available

for each hook execution that fails (joined, then changed)

Revision history for this message
Paul Goins (vultaire) wrote :

Also observed with cs:ntp-45.

Revision history for this message
Graeme Moss (graememoss) wrote :

Have the same problem with ntp rev 47 from charmhub
unit-ntp-10: 09:42:16 WARNING unit.ntp/10.nrpe-external-master-relation-joined File "/var/lib/juju/agents/unit-ntp-10/.venv/lib/python3.6/site-packages/charms/reactive/relations.py", line 716, in set_state
unit-ntp-10: 09:42:16 WARNING unit.ntp/10.nrpe-external-master-relation-joined if self.key not in value['conversations']:
unit-ntp-10: 09:42:16 WARNING unit.ntp/10.nrpe-external-master-relation-joined TypeError: 'NoneType' object is not subscriptable
unit-ntp-10: 09:42:16 ERROR juju.worker.uniter.operation hook "nrpe-external-master-relation-joined" (via explicit, bespoke hook script) failed: exit status 1
unit-ntp-10: 09:42:16 INFO juju.worker.uniter awaiting error resolution for "relation-joined" hook

tried using debug-hook I get the following:

bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
root@cz21260l6h:~# charms.reactive set_state nrpe-external-master.available
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
Ambiguous possibilities for JUJU_CHARM_DIR; please use --charm or run within a Juju hook context
root@cz21260l6h:~#

The debug-hooks does not go into a session to run the charm.reactive commands.

Revision history for this message
Graeme Moss (graememoss) wrote :

2022-04-12 09:59:37 INFO juju.worker.uniter resolver.go:150 awaiting error resolution for "relation-joined" hook
2022-04-12 09:59:42 INFO juju.worker.uniter resolver.go:150 awaiting error resolution for "relation-joined" hook
2022-04-12 09:59:50 INFO juju.worker.uniter.runner runner.go:465 executing nrpe-external-master-relation-joined via debug-hooks; explicit, bespoke hook script

Still nothing on the debug-hook
bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
root@cz21260l6h:~#

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.