]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: fix continous smb MgrDBNotReady 68483/head
authorPedro Gonzalez Gomez <pegonzal@ibm.com>
Tue, 21 Apr 2026 02:40:00 +0000 (04:40 +0200)
committerPedro Gonzalez Gomez <pegonzal@ibm.com>
Wed, 22 Apr 2026 09:13:35 +0000 (11:13 +0200)
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 <pegonzal@ibm.com>
src/pybind/mgr/dashboard/controllers/smb.py
src/pybind/mgr/prometheus/module.py

index 6bee5f0c3b05c0fa10b4a95efe2f3440cb9d434e..d145ca39255aad1fbb585854080c670deed70ecd 100644 (file)
@@ -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):
index 5477df02e12ad33227fc755baa0953c065dd8f31..366e9d458c501f54d471bea48ff445be46604794 100644 (file)
@@ -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: