From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 83AD11FF13C for ; Thu, 19 Feb 2026 13:34:04 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id ADF0C13BD2; Thu, 19 Feb 2026 13:35:03 +0100 (CET) From: Lukas Sichert To: pve-devel@lists.proxmox.com Subject: [PATCH manager v2] fix #4130: external metric: better handle failed connections Date: Thu, 19 Feb 2026 13:34:17 +0100 Message-ID: <20260219123417.597950-1-l.sichert@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Message-ID-Hash: XXTPHYVRTNOQUPCQKTUZU3SYMO7WTFM5 X-Message-ID-Hash: XXTPHYVRTNOQUPCQKTUZU3SYMO7WTFM5 X-MailFrom: lsichert@pve.proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Lukas Sichert X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When an external metric server configured to use TCP is unreachable, the storage and VM indicators of the cluster nodes in the UI turn gray. This is because, currently, a failed connection attempt raises an unhandled exception, which aborts the status update flow. As the connection attempts happen at the beginning of the update process, status information is then not broadcasted within the system or across the cluster. After five minutes without updates, the frontend marks the indicators as gray. To catch connection errors, wrap connection establishment in an eval block. The implementation ensures that other connections to external metric servers are still established, even if one fails. Signed-off-by: Lukas Sichert --- Notes: changes from v1 to v2: -add the SafeSyslog import required for syslog() -correct bug ID: #4911 -> #4130 -move the push operation outside the eval block as suggested by Thomas Regarding catching the errors at a higher level: Since this function is iterated through the plugins, not catching the error here would mean, that not all the plugins are checked. PVE/ExtMetric.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PVE/ExtMetric.pm b/PVE/ExtMetric.pm index ebc2817b..18815efd 100644 --- a/PVE/ExtMetric.pm +++ b/PVE/ExtMetric.pm @@ -7,6 +7,7 @@ use PVE::Status::Plugin; use PVE::Status::Graphite; use PVE::Status::InfluxDB; use PVE::Status::OpenTelemetry; +use PVE::SafeSyslog; PVE::Status::Graphite->register(); PVE::Status::InfluxDB->register(); @@ -52,8 +53,12 @@ sub transactions_start { $cfg, sub { my ($plugin, $id, $plugin_config) = @_; - - my $connection = $plugin->_connect($plugin_config, $id); + + my $connection = eval { $plugin->_connect($plugin_config, $id);}; + if (my $err = $@) { + syslog( "warning", "connection for plugin '$id' failed: $err"); + return; + } push @$transactions, { -- 2.47.3