[pve-devel] [PATCH manager] ui: ceph: osd: handle edge case with dead node

Fabian Ebner f.ebner at proxmox.com
Tue Nov 16 14:08:22 CET 2021


If there is a left-over entry for a dead node in the ceph osd tree
the panel wouldn't show and produce an
    Uncaught TypeError: data.versions is undefined
because of an access
    node.version = data.versions[node.name];
further below (not visible in the patch itself).

AFAICT, the same issue would also happen when something went wrong
with getting the broadcasted ceph-versions, or when a node is part
of Ceph, but not PVE.

Handle the situation gracefully by always initializing data.versions.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 www/manager6/ceph/OSD.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index 9e737852..30671dc4 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -316,7 +316,8 @@ Ext.define('PVE.node.CephOsdTree', {
 		    if (selected.length) {
 			name = selected[0].data.name;
 		    }
-		    vm.set('versions', data.versions || {});
+		    data.versions = data.versions || {};
+		    vm.set('versions', data.versions);
 		    // extract max version
 		    let maxversion = "0";
 		    let mixedversions = false;
-- 
2.30.2






More information about the pve-devel mailing list