From: Pedro Gonzalez Gomez Date: Tue, 21 Apr 2026 02:40:00 +0000 (+0200) Subject: mgr: fix continous smb MgrDBNotReady X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e23afba8b03436e40359e2bc525bbf1dad36c9ec;p=ceph.git mgr: fix continous smb MgrDBNotReady Check db_ready before trying to fetch prometheus metrics and smb status (from dashboard) Fixes: https://tracker.ceph.com/issues/76151 Signed-off-by: Pedro Gonzalez Gomez --- diff --git a/src/pybind/mgr/dashboard/controllers/smb.py b/src/pybind/mgr/dashboard/controllers/smb.py index 6bee5f0c3b05..d145ca39255a 100644 --- a/src/pybind/mgr/dashboard/controllers/smb.py +++ b/src/pybind/mgr/dashboard/controllers/smb.py @@ -498,6 +498,9 @@ class SMBStatus(RESTController): def status(self): status = {'available': False, 'message': None} try: + if not mgr.remote('smb', 'db_ready'): + status['message'] = 'SMB DB not ready. SMB module is unavailable.' + return status mgr.remote('smb', 'show', ['ceph.smb.cluster']) status['available'] = True except (ImportError, RuntimeError): diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 5477df02e12a..366e9d458c50 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -1940,6 +1940,16 @@ class Module(MgrModule, OrchestratorClientMixin): self.log.debug("Orchestrator not available") return + try: + if not self.remote('smb', 'db_ready'): + self.log.debug( + "SMB DB not ready, skipping SMB metadata collection" + ) + return + except Exception as e: + self.log.debug(f"SMB DB readiness check failed: {str(e)}") + return + smb_version = "" try: