]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: fix continous smb MgrDBNotReady 68598/head
authorPedro Gonzalez Gomez <pegonzal@ibm.com>
Tue, 21 Apr 2026 02:40:00 +0000 (04:40 +0200)
committerPedro Gonzalez Gomez <pegonzal@ibm.com>
Fri, 24 Apr 2026 10:46:30 +0000 (12:46 +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>
(cherry picked from commit e23afba8b03436e40359e2bc525bbf1dad36c9ec)

src/pybind/mgr/dashboard/controllers/smb.py
src/pybind/mgr/prometheus/module.py

index 88f471c76eb56507df647835e0a6ec2f6f25d4de..a1a59f2a0edecf295cfff7da25fcf4042442dfcc 100644 (file)
@@ -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):
index 1bcb1e255c8aa7a48bd9a7ef6fb8587d98753a27..71a83b0447a9ca9070eeae7e549137768fdcb3c9 100644 (file)
@@ -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: