In test run https://solutions.qa.canonical.com/testruns/4d34da56-35f8-47eb-82ef-2020c2d8686b, which uses the following versions:
maas 3.2.9-
juju 2.9.44
ceph quincy/stable
charms yoga/stable
charm-ceph-dashboard latest/edge (rev 38)
ceph-dashboard fails installing on the "certificates-relation-changed" hook with the following message in the debug log:
==================
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/./src/charm.py", line 755, in <module>
main(CephDashboardCharm)
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/venv/ops/main.py", line 431, in main
_emit_charm_event(charm, dispatcher.event_name)
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/venv/ops/main.py", line 142, in _emit_charm_event
event_to_emit.emit(*args, **kwargs)
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/venv/ops/framework.py", line 316, in emit
framework._emit(event)
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/venv/ops/framework.py", line 784, in _emit
self._reemit(event_path)
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/venv/ops/framework.py", line 857, in _reemit
custom_handler(event)
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/venv/interface_tls_certificates/ca_client.py", line 687, in _on_relation_changed
self.ready_events[request_type].emit()
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/venv/ops/framework.py", line 316, in emit
framework._emit(event)
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/venv/ops/framework.py", line 784, in _emit
self._reemit(event_path)
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/venv/ops/framework.py", line 857, in _reemit
custom_handler(event)
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/./src/charm.py", line 751, in _enable_ssl_from_relation
self._configure_tls_from_relation()
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/./src/charm.py", line 726, in _configure_tls_from_relation
self._configure_tls(key, cert, ca_cert, self.TLS_VAULT_CA_CERT_PATH)
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/./src/charm.py", line 583, in _configure_tls
ceph_utils.dashboard_set_ssl_certificate(
File "/var/lib/juju/agents/unit-ceph-dashboard-0/charm/venv/charms_ceph/utils.py", line 3609, in _dashboard_set_ssl_artifact
subprocess.check_call(cmd)
File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ceph', 'dashboard', 'set-ssl-certificate', 'juju-218f1e-1-lxd-1', '-i', PosixPath('/etc/ceph/ceph-dashboard.crt')]' returned non-zero exit status 95.
==================
Since it doesn't post the ceph commands stdout and stderr, I'm not sure what exactly went wrong in this command. Vault is initialized at this point, so the certificates should be present.
More logs and configs can be found here: https://oil-jenkins.canonical.com/artifacts/4d34da56-35f8-47eb-82ef-2020c2d8686b/index.html
The root cause for this error is a race condition between mgr enablement and certificates relation handle:
Log Print: 29T23:17: 47.373+ 0000 7f168d179640 -1 mgr.server reply reply (95) Operation not supported Module 'dashboard' is not enabled (required by command 'dashboard set-ssl- certificate' ): use ceph mgr module enable dashboard to enable it
2023-08-
The newly split event handlers require to defer the handling until dashboard mgr module is enabled.