From 326ff3b1c623345ae9a8860a171776b26fdee349 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 10 Apr 2025 09:21:08 +0200 Subject: [PATCH] ceph versions: do not try to parse empty string Might not be expected to happen but never makes sense to try here, if we can then broadcast the correct version info anyway. Might be related to an error reported in the forum [0]. [0]: https://forum.proxmox.com/threads/bug-invalid-json.164835/ Signed-off-by: Thomas Lamprecht --- PVE/Ceph/Services.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/Ceph/Services.pm b/PVE/Ceph/Services.pm index f002316b..04bf296d 100644 --- a/PVE/Ceph/Services.pm +++ b/PVE/Ceph/Services.pm @@ -54,7 +54,7 @@ sub broadcast_ceph_versions { my $nodename = PVE::INotify::nodename(); my $old_versions = PVE::Cluster::get_node_kv("ceph-versions", $nodename); - if (defined(my $old_version_raw = $old_versions->{$nodename})) { + if (length(my $old_version_raw = $old_versions->{$nodename})) { my $old = eval { decode_json($old_version_raw) }; warn "failed to parse ceph-versions '$old_version_raw' as JSON - $@" if $@; # should not happen if (defined($old) && $old->{buildcommit} eq $buildcommit && $old->{version}->{str} eq $version) {