Traceback (most recent call last):
File "/var/lib/juju/agents/unit-postgresql-1/charm/./src/charm.py", line 1475, in <module>
main(PostgresqlOperatorCharm)
File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/main.py", line 436, in main
_emit_charm_event(charm, dispatcher.event_name)
File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/main.py", line 144, in _emit_charm_event
event_to_emit.emit(*args, **kwargs)
File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/framework.py", line 340, in emit
framework._emit(event)
File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/framework.py", line 842, in _emit
self._reemit(event_path)
File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/framework.py", line 931, in _reemit
custom_handler(event)
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/postgresql_k8s/v0/postgresql_tls.py", line 117, in _on_tls_relation_joined
self._request_certificate(None)
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/postgresql_k8s/v0/postgresql_tls.py", line 97, in _request_certificate
self.charm.set_secret(SCOPE, "key", key.decode("utf-8"))
File "/var/lib/juju/agents/unit-postgresql-1/charm/./src/charm.py", line 264, in set_secret
self.peer_relation_unit.update_relation_data(peers.id, {key: value})
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 451, in wrapper
return f(self, *args, **kwargs)
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 999, in update_relation_data
return self._update_relation_data(relation, data)
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 1582, in _update_relation_data
_, normal_fields = self._process_secret_fields(
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 800, in _process_secret_fields
if group_result := operation(relation, group, secret_fields, *args, **kwargs):
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 1096, in _add_or_update_relation_secrets
return self._add_relation_secret(relation, group, secret_fields, data, uri_to_databag)
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 462, in wrapper
return f(self, *args, **kwargs)
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 1050, in _add_relation_secret
secret = self.secrets.add(label, content, relation)
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 571, in add
secret.add_secret(content, relation)
File "/var/lib/juju/agents/unit-postgresql-1/charm/lib/charms/data_platform_libs/v0/data_interfaces.py", line 494, in add_secret
->>>>>>>>>>>>>>>>>>>>> secret = self.charm.app.add_secret(content, label=self.label)
File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/model.py", line 442, in add_secret
id = self._backend.secret_add(
File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/model.py", line 3372, in secret_add
result = self._run('secret-add', *args, return_output=True)
File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/model.py", line 2948, in _run
raise ModelError(e.stderr) from e
ops.model.ModelError: ERROR this unit is not the leader