From ace6018ecc75c5f666370ca60ffd33cc23e62b0a 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 (cherry picked from commit e23afba8b03436e40359e2bc525bbf1dad36c9ec) --- 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 88f471c76eb5..a1a59f2a0ede 100644 --- a/src/pybind/mgr/dashboard/controllers/smb.py +++ b/src/pybind/mgr/dashboard/controllers/smb.py @@ -451,6 +451,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 1bcb1e255c8a..71a83b0447a9 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -1874,6 +1874,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