all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-manager 1/1] pvestatd: prevent warnings for non-existing network devices
Date: Wed, 30 Jul 2025 14:44:48 +0200	[thread overview]
Message-ID: <20250730124451.184806-1-s.hanreich@proxmox.com> (raw)

pvestatd runs the update loop for every network device present on the
host. This includes many dynamically created / removed network
interfaces (tap devices, veths, fw bridges). This triggers a warning
if the network device isn't yet in the cached version of the ip link
output:

pvestatd[1011]: Use of uninitialized value in string eq at /usr/share/perl5/PVE/Network.pm line 998.

Silently fail such errors for now, since they should normally affect
only such dynamically created devices and no physical devices. Even
for hotplugged physical devices this should be corrected the next time
the ip link cache gets invalidated. The worst case scenario in this
case is at most 15 minutes of missing netin/out metrics for that link.

Reported-by: Hannes Dürr <h.duerr@proxmox.com>
Reported-by: Max Carrara <m.carrara@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 PVE/Service/pvestatd.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm
index b7cb06b18..0b338899e 100755
--- a/PVE/Service/pvestatd.pm
+++ b/PVE/Service/pvestatd.pm
@@ -189,7 +189,7 @@ sub update_node_status {
     for my $dev (keys %$netdev) {
         my $ip_link = $cached_ip_links->{$dev};
 
-        if (PVE::Network::ip_link_is_physical($ip_link)) {
+        if ($ip_link && PVE::Network::ip_link_is_physical($ip_link)) {
             $netdev->{$dev}->{type} = 'physical';
         } else {
             $netdev->{$dev}->{type} = 'virtual';
-- 
2.47.2


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

             reply	other threads:[~2025-07-30 12:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30 12:44 Stefan Hanreich [this message]
2025-07-30 12:51 ` 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=20250730124451.184806-1-s.hanreich@proxmox.com \
    --to=s.hanreich@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