When removing a single unit with remove-application, it will cause:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-opensearch-0/charm/./src/charm.py", line 213, in <module>
main(OpenSearchOperatorCharm)
File "/var/lib/juju/agents/unit-opensearch-0/charm/venv/ops/main.py", line 548, in main
manager.run()
File "/var/lib/juju/agents/unit-opensearch-0/charm/venv/ops/main.py", line 527, in run
self._emit()
File "/var/lib/juju/agents/unit-opensearch-0/charm/venv/ops/main.py", line 516, in _emit
_emit_charm_event(self.charm, self.dispatcher.event_name)
File "/var/lib/juju/agents/unit-opensearch-0/charm/venv/ops/main.py", line 147, in _emit_charm_event
event_to_emit.emit(*args, **kwargs)
File "/var/lib/juju/agents/unit-opensearch-0/charm/venv/ops/framework.py", line 348, in emit
framework._emit(event)
File "/var/lib/juju/agents/unit-opensearch-0/charm/venv/ops/framework.py", line 860, in _emit
self._reemit(event_path)
File "/var/lib/juju/agents/unit-opensearch-0/charm/venv/ops/framework.py", line 950, in _reemit
custom_handler(event)
File "/var/lib/juju/agents/unit-opensearch-0/charm/lib/charms/opensearch/v0/opensearch_base_charm.py", line 495, in _on_opensearch_data_storage_detaching
self.peers_data.delete(Scope.APP, "bootstrap_contributors_count")
File "/var/lib/juju/agents/unit-opensearch-0/charm/lib/charms/opensearch/v0/opensearch_internal_data.py", line 182, in delete
self.put(scope, key, None)
File "/var/lib/juju/agents/unit-opensearch-0/charm/lib/charms/opensearch/v0/opensearch_internal_data.py", line 115, in put
self.put_or_delete(data, key, value)
File "/var/lib/juju/agents/unit-opensearch-0/charm/lib/charms/opensearch/v0/opensearch_internal_data.py", line 94, in put_or_delete
del data[key]
KeyError: 'bootstrap_contributors_count'
When removing a single unit with
remove-application
, it will cause:As the peer relation does not exist anymore.