Debian Networking: networking.service is marked as failed after reboot, but network config is correct

Bug #1983503 reported by Fabiano Correa Mercer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Fabiano Correa Mercer

Bug Description

Brief Description

It was detected the networking.service is marked as failing after reboot, but the network config is installed on the kernel

The package ifupdown has some auxiliary directories (if-up.d, if-pre-up.d, etc...) where other packages can add scripts to be executed during network bring up.

In our case these ones:

    ifupdown-extra
    nss-pam-ldapd
    vlan
    ifenslave

When the command "ifup -a" is executed by the service, it starts to run the scripts for each interface in /etc/network/interfaces.d/ and finally executes with the argument "$IFACE = all". But several scripts in ifupdown-extra are not prepared to handle "-all" and finish with error

For this case my proposal is to add to this scripts:

// code placeholder
diff --git a/if-up-scripts/check-duplicate-ip b/if-up-scripts/check-duplicate-ip
index a07668d..9d38217 100755
--- a/if-up-scripts/check-duplicate-ip
+++ b/if-up-scripts/check-duplicate-ip
@@ -103,6 +103,11 @@ if [ -z "$IFACE" ] ; then
     exit 0
 fi

+if [ "$IFACE" == "--all" ] ; then
+ # this script only handles one interface per run
+ exit 0
+fi
+
 # If the interface is a serial (sl), WAN interfaces (ww) or localhost (lo) then skip the test
 # as it does not make sense in these
 case $IFACE in
@@ -135,8 +140,6 @@ else
 fi
 ARP_COUNT=${ARP_COUNT:-2}

-
-
 [ -z "$IF_ADDRESS" ] && find_ip
 # Still no IP? Bail out
 if [ -z "$IF_ADDRESS" ] ; then
diff --git a/if-up-scripts/check-duplicate-ip6 b/if-up-scripts/check-duplicate-ip6
index f48cdd3..1b57a59 100755
--- a/if-up-scripts/check-duplicate-ip6
+++ b/if-up-scripts/check-duplicate-ip6
@@ -105,6 +105,11 @@ if [ -z "$IFACE" ] ; then
     exit 1
 fi

+if [ "$IFACE" == "--all" ] ; then
+ # this script only handles one interface per run
+ exit 0
+fi
+
 # If the interface is a serial (sl), WAN interfaces (ww) or localhost (lo) then skip the test
 # as it does not make sense in these
 case $IFACE in
diff --git a/if-up-scripts/check-gateway b/if-up-scripts/check-gateway
index b3fdeb6..e9671ca 100755
--- a/if-up-scripts/check-gateway
+++ b/if-up-scripts/check-gateway
@@ -55,6 +55,11 @@ VERBOSITY=${VERBOSITY:-0}
 # Break out if we don't have an interface to work with
 [ -z "$IFACE" ] && exit 0

+if [ "$IFACE" == "--all" ] ; then
+ # this script only handles one interface per run
+ exit 0
+fi
+
 if [ "$DO_SYSLOG" = "yes" ] ; then
     OUTPUT="logger -i -p daemon.err -s"
 else
diff --git a/if-up-scripts/check-network-cable b/if-up-scripts/check-network-cable
index 94279eb..5a85738 100755
--- a/if-up-scripts/check-network-cable
+++ b/if-up-scripts/check-network-cable
@@ -172,6 +172,11 @@ check_bond_status() {
     exit 1
 }

+if [ "$IFACE" == "--all" ] ; then
+ # this script only handles one interface per run
+ exit 0
+fi
+
 # Check our IFACE name, run the status check depending on the type of interface
 case $IFACE in
     en* | eth*)

In the case of nss-pam-ldapd (that contain nslcd package) the script /etc/network/if-up.d/nslcd is failing when there are loopback interfaces with label (lo:X) as the script only tests the interface "lo" to exit with 0, when it should also exit for "lo:X"
This config is common on AIO-SX installations.

And one last error is on the hiera file, if we are configuring interface (like mgmt) on the loopback, we are generating 2 identical entries (lo and lo:1) that make the ifup command to configure twice the same addresses and return an error.

Severity

Provide the severity of the defect.

<Minor: System/Feature is usable with minor issue>

Steps to Reproduce

With the following config (VBox with AIO-SX, IPv4):

source /etc/platform/openrc
system host-if-modify controller-0 enp0s3 -c platform -n oam0
system interface-network-assign controller-0 oam0 oam
system ntp-modify ntpservers=0.pool.ntp.org,1.pool.ntp.org
system storage-backend-add ceph --confirmed
system host-disk-list controller-0
system host-disk-list controller-0 | awk '/\/dev\/sdb/{print $2}' | xargs -i system host-stor-add controller-0 {}
system host-stor-list controller-0
system host-if-modify 1 enp0s9 -n test1 -c data --ipv4-mode static
system host-addr-add 1 test1 11.0.0.1 24
system host-route-add 1 test1 11.11.11.0 24 11.0.0.254 11
system host-route-add 1 test1 11.12.11.0 24 11.0.0.254 22
system host-route-add 1 test1 11.13.11.0 24 11.0.0.254 33
system host-route-add 1 test1 11.44.44.0 24 11.0.0.254 44system host-unlock 1
 Expected Behavior
After return service should not be failing

Actual Behavior

Service is in failed

root@controller-0:/var/home/sysadmin# systemctl status networking.service
● networking.service - Raise network interfaces
     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Wed 2022-06-08 09:28:52 UTC; 1 day 5h ago
       Docs: man:interfaces(5)
   Main PID: 755 (code=exited, status=1/FAILURE)
        CPU: 553ms

Reproducibility

Reproducible

System Configuration

VBox, AIO-SX, IPv4

Load info (eg: 2022-03-10_20-00-07)

BUILD_ID="2022-06-06_19-00-02"

Last Pass

Never tested

Test Activity

Developer Testing

Workaround

none

Changed in starlingx:
assignee: nobody → Fabiano Correa Mercer (fcorream)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tools (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/tools/+/852279

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/c/starlingx/config/+/852668
Committed: https://opendev.org/starlingx/config/commit/63e94266b460662cca6f2e1903febb0b2a26d7a2
Submitter: "Zuul (22348)"
Branch: master

commit 63e94266b460662cca6f2e1903febb0b2a26d7a2
Author: Fabiano Correa Mercer <email address hidden>
Date: Tue Aug 9 19:27:45 2022 +0000

    Apply static IP address for alias interfaces

    It happpens because "ifup -a" is executed by the service.
    But it fails because /var/run/network-scripts.puppet/interfaces
    has 2 interfaces with same IP address.
    It can happen when an interface (i.e: mgmt) is configured on the loopback.
    The same IP Address is configured for interfaces: lo and lo:1.
    For this case parent interface "lo" should be defined as Manual and not
    receive a Static IP address, while "lo:1" will receive the Static IP
    address.

    Test Plan (Debian only):
    PASS Configure MGMT in the loopback interface AIO-SX
    PASS Configure MGMT in the ETH interface AIO-DX
    PASS Check systemctl status networking.service after unlock

    Partial-Bug: #1983503

    Change-Id: Ic2f07f847cb461dd01aa8cd33faae99ceb827eb2
    Signed-off-by: Fabiano Mercer <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to integ (master)

Reviewed: https://review.opendev.org/c/starlingx/integ/+/852049
Committed: https://opendev.org/starlingx/integ/commit/84017b4290d48a825df4d4f7937744196d083343
Submitter: "Zuul (22348)"
Branch: master

commit 84017b4290d48a825df4d4f7937744196d083343
Author: Fabiano Mercer <email address hidden>
Date: Fri Jul 29 15:54:41 2022 -0300

    Ignore --all/lo* for ifupdown/nslcd scripts

    It was detected the networking.service is marked as failing after reboot.
    It happpens because "ifup -a" is executed by the service.
    It starts to run the scripts in /etc/network/interfaces.d/.
    But several scripts in ifupdown-extra are not prepared to handle "-all".

    In the case of nss-pam-ldapd the script /etc/network/if-up.d/nslcd
    is failing when there are loopback interfaces with label (lo:X) as the
    script only tests the interface "lo".

    Test Plan (Debian only - AIO-SX and AIO-DX)):
    PASS Check systemctl status networking.service after unlock

    Closes-Bug: #1983503

    Change-Id: I1fd9e2ea75233d987d6f1f2aa5a3395ab2885e2b
    Signed-off-by: Fabiano Mercer <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tools (master)

Reviewed: https://review.opendev.org/c/starlingx/tools/+/852279
Committed: https://opendev.org/starlingx/tools/commit/feb4c834e1ab778460645d9ec4f7358745ead9d9
Submitter: "Zuul (22348)"
Branch: master

commit feb4c834e1ab778460645d9ec4f7358745ead9d9
Author: Fabiano Mercer <email address hidden>
Date: Fri Aug 5 13:01:08 2022 -0300

    Ignore --all/lo* for ifupdown/nslcd scripts

    It was detected the networking.service is marked as failing after reboot.
    It happpens because "ifup -a" is executed by the service.
    It starts to run the scripts in /etc/network/interfaces.d/.
    But several scripts in ifupdown-extra are not prepared to handle "-all".

    In the case of nss-pam-ldapd the script /etc/network/if-up.d/nslcd
    is failing when there are loopback interfaces with label (lo:X) as the
    script only tests the interface "lo".

    Test Plan (Debian only - AIO-SX and AIO-DX)):
    PASS Check systemctl status networking.service after unlock

    Partial-Bug: #1983503

    Signed-off-by: Fabiano Mercer <email address hidden>

    Depends-On: https://review.opendev.org/c/starlingx/integ/+/852049
    Change-Id: I67a3a3113d13f811613c647d3176050417f5a909

Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.8.0 stx.debian stx.networking
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.