pacemaker-remote-relation-changed hook errors on trigger-corosync-update

Bug #1920124 reported by Aurelien Lourot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack HA Cluster Charm
Fix Released
Critical
Unassigned

Bug Description

Seen in the charm-masakari-monitors gate. [0][1] At deploy time the charm-hacluster's pacemaker-remote-relation-changed hook errors with

----------
ERROR permission denied
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-hacluster-0/charm/hooks/pacemaker-remote-relation-changed", line 752, in <module>
    hooks.execute(sys.argv)
  File "/var/lib/juju/agents/unit-hacluster-0/charm/charmhelpers/core/hookenv.py", line 945, in execute
    self._hooks[hook_name]()
  File "/var/lib/juju/agents/unit-hacluster-0/charm/hooks/pacemaker-remote-relation-changed", line 340, in ha_relation_changed
    trigger_corosync_update_from_leader(
  File "/var/lib/juju/agents/unit-hacluster-0/charm/hooks/utils.py", line 1597, in trigger_corosync_update_from_leader
    corosync_update_uuid = relation_get(
  File "/var/lib/juju/agents/unit-hacluster-0/charm/charmhelpers/core/hookenv.py", line 93, in wrapper
    res = func(*args, **kwargs)
  File "/var/lib/juju/agents/unit-hacluster-0/charm/charmhelpers/core/hookenv.py", line 470, in relation_get
    return json.loads(subprocess.check_output(_args).decode('UTF-8'))
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['relation-get', '--format=json', '-r', 'hanode:3', 'trigger-corosync-update', 'pacemaker-remote/0']' returned non-zero exit status 1.
----------

This code path was introduced recently [2] while implementing the new `update-ring` action. [3] Unfortunately ha_relation_changed() is not only called in `ha` relation hooks but also in other relations, which then leads to this error.

[0] https://review.opendev.org/c/openstack/charm-masakari-monitors/+/776366
[1] https://openstack-ci-reports.ubuntu.com/artifacts/test_charm_pipeline_func_smoke/openstack/charm-masakari-monitors/776366/2/22687/index.html
[2] https://review.opendev.org/c/openstack/charm-hacluster/+/741592/36/hooks/hooks.py
[3] lp:1400481

Changed in charm-hacluster:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Aurelien Lourot (aurelien-lourot)
Revision history for this message
Aurelien Lourot (aurelien-lourot) wrote :
Changed in charm-hacluster:
status: In Progress → Fix Committed
milestone: none → 21.04
Changed in charm-hacluster:
assignee: Aurelien Lourot (aurelien-lourot) → nobody
Changed in charm-hacluster:
status: Fix Committed → Fix Released
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.