From e23afba8b03436e40359e2bc525bbf1dad36c9ec Mon Sep 17 00:00:00 2001 From: Pedro Gonzalez Gomez Date: Tue, 21 Apr 2026 04:40:00 +0200 Subject: [PATCH] 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 --- src/pybind/mgr/dashboard/controllers/smb.py | 3 +++ src/pybind/mgr/prometheus/module.py | 10 ++++++++++ 2 files changed, 13 insertions(+) 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: -- 2.47.3