[pve-devel] [PATCH network] frr: early exit on apply when frr is not installed
Gabriel Goller
g.goller at proxmox.com
Wed Jul 23 17:49:34 CEST 2025
When frr isn't installed (happens e.g. on pve8 to 9 update) then the SDN
and Networking "Apply Configuration" task will throw an error because it
can't access the frr daemons file to check if the daemons are enabled.
In order to fix this, check if the frr config file exists before
continuing with the frr config generation.
Also make the "daemons file does not exist" error nicer.
Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
---
src/PVE/Network/SDN.pm | 5 +++++
src/PVE/Network/SDN/Frr.pm | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/PVE/Network/SDN.pm b/src/PVE/Network/SDN.pm
index 66665a409305..d2ba31283a57 100644
--- a/src/PVE/Network/SDN.pm
+++ b/src/PVE/Network/SDN.pm
@@ -355,6 +355,11 @@ sub get_frr_daemon_status {
sub generate_frr_config {
my ($apply) = @_;
+ if (!-e $PVE::Network::SDN::Frr::FRR_CONFIG_FILE) {
+ print "frr is not installed, not generating any frr configuration\n";
+ return;
+ }
+
my $running_config = PVE::Network::SDN::running_config();
my $fabric_config = PVE::Network::SDN::Fabrics::config(1);
diff --git a/src/PVE/Network/SDN/Frr.pm b/src/PVE/Network/SDN/Frr.pm
index 52fa456e2181..451ce1d87212 100644
--- a/src/PVE/Network/SDN/Frr.pm
+++ b/src/PVE/Network/SDN/Frr.pm
@@ -44,7 +44,7 @@ sub read_local_frr_config {
}
}
-my $FRR_CONFIG_FILE = "/etc/frr/frr.conf";
+our $FRR_CONFIG_FILE = "/etc/frr/frr.conf";
=head3 apply()
@@ -130,7 +130,7 @@ sub set_daemon_status {
my ($daemon_status, $set_default) = @_;
my $daemons_file = "/etc/frr/daemons";
- die "daemons file does not exist" if !-e $daemons_file;
+ die "/etc/frr/daemons file does not exist; is the frr package installed?\n" if !-e $daemons_file;
for my $daemon (keys %$daemon_status) {
die "$daemon is not SDN managed" if !defined $SDN_DAEMONS_DEFAULT->{$daemon};
--
2.39.5
More information about the pve-devel
mailing list