all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: ceph: osd: handle edge case with dead node
Date: Tue, 16 Nov 2021 14:08:22 +0100	[thread overview]
Message-ID: <20211116130822.47803-1-f.ebner@proxmox.com> (raw)

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@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





             reply	other threads:[~2021-11-16 13:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 13:08 Fabian Ebner [this message]
2021-11-16 13:24 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211116130822.47803-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal