From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id C7AFD1FF09B for ; Mon, 09 Nov 2026 11:01:52 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7F1DF215DA; Mon, 09 Nov 2026 11:01:49 +0100 (CET) Date: Mon, 9 Nov 2026 11:01:42 +0100 From: Gabriel Goller To: Shay Sevet Subject: Re: [RFC] ifupdown2: missing bond-primary device prevents the bond from being created Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20260504 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794218503676 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.520 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) KAM_GOOGLE_REDIR 1.5 Use of Google redir RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: EAHPIR3YQLVC5VHG2YO23YVSY7JFBZ7N X-Message-ID-Hash: EAHPIR3YQLVC5VHG2YO23YVSY7JFBZ7N X-MailFrom: g.goller@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: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 07.11.2026 11:52, Shay Sevet wrote: > Hi, > > I hit this on a 3-node PVE 9.2 cluster and want to report it together with > a proposed fix. > > Problem > ------- > If an active-backup bond's `bond-primary` names a device that does not > exist at boot (for example a USB NIC that died, was unplugged, or was > replaced and came back under a new MAC-based name), ifupdown2 never creates > the bond at all. Every interface stacked on it fails too (vlan-aware > bridge, VLANs, addresses), so the node loses all networking, although the > other bond slave is present and has link. Same result on `ifreload -a`. > > error: ifname not present in cache > error: vmbrX: bridge port bond0 does not exist > > This defeats the redundancy the bond was configured for: losing the > preferred device takes the whole bond down instead of failing over. > > Reproduced on ifupdown2 3.3.0-1+pmx12 and 3.3.0-1+pmx13 (Debian 13 VM and > on PVE 9.2.26 hosts). The related missing-slave case is already handled in > pmx13 (Proxmox bug 8117 / upstream PR #355); the missing primary is not. > > Cause > ----- > `bond-primary` is resolved with `self.cache.get_ifindex()` in > `ifupdown2/addons/bond.py` (`get_ifla_bond_attr_from_user_config()`). For > an unknown name it raises `NetlinkCacheIfnameNotFoundError`; only > `KeyError` is caught there, so the exception aborts the bond setup before > the link is created. > > Proposed fix > ------------ > Treat a missing bond-primary device like an invalid value: log a warning, > set the interface status to warning, and create the bond without a primary. > The configuration is left untouched; a later ifreload sets the primary once > the device exists. > > Upstream PR (with a unit test that fails without the change and passes with > it): > https://www.google.com/url?q=https://github.com/CumulusNetworks/ifupdown2/pull/358&source=gmail&ust=1794167497172000&sa=E > > I have been running a rebuilt 3.3.0-1+pmx13 with this change on all three > nodes. A rebased quilt patch for the Proxmox packaging is available if > useful. > > Workaround until then: drop `bond-primary` and set it after the bond is up, > only if the device exists: > post-up echo > /sys/class/net/bond0/bonding/primary 2>/dev/null || > true > > I found the bug on my own setup; the fix was developed with AI assistance > (Claude) and reviewed and tested by me. > > Thanks, > Shay Sevet Thanks, I recently submitted and backported: https://github.com/CumulusNetworks/ifupdown2/pull/355 But it looks a little bit different from your PR (mine doesn't consider bond-primary, only bond-slaves). I'll have a look at your PR in the next weeks! Thanks! Gabriel