IndexError: list index out of range

Bug #2009625 reported by Felipe Reyes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charm-interface-keystone
New
Undecided
Unassigned

Bug Description

when tearing down a model the relation-departed hook fails with the stacktrace below. I think the interface should be checking if there are relations available before querying data from them at https://opendev.org/openstack/charm-interface-keystone/src/branch/master/requires.py#L48

unit-ironic-api-0: 14:32:12 ERROR unit.ironic-api/0.juju-log identity-service:10: Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-ironic-api-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-ironic-api-0/.venv/lib/python3.10/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-ironic-api-0/.venv/lib/python3.10/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-ironic-api-0/.venv/lib/python3.10/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-ironic-api-0/charm/hooks/relations/keystone/requires.py", line 140, in departed
    self.update_flags()
  File "/var/lib/juju/agents/unit-ironic-api-0/charm/hooks/relations/keystone/requires.py", line 112, in update_flags
    if self.base_data_complete():
  File "/var/lib/juju/agents/unit-ironic-api-0/charm/hooks/relations/keystone/requires.py", line 147, in base_data_complete
    'service_host': self.service_host(),
  File "/var/lib/juju/agents/unit-ironic-api-0/charm/hooks/relations/keystone/requires.py", line 48, in _accessor_internal
    return self.relations[0].received_app_raw.get(
  File "/var/lib/juju/agents/unit-ironic-api-0/.venv/lib/python3.10/site-packages/charms/reactive/endpoints.py", line 654, in __getitem__
    return super().__getitem__(self._translate_key(key))
IndexError: list index out of range

Revision history for this message
Felipe Reyes (freyes) wrote :

probably the custom metaclass could be dropped in favor of the one provided by charms.reactive.

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.