Skip to content

Improve logging of ACD conflicts

Beniamino Galvani requested to merge bg/dad-failure-log-rh2123212 into main

Summary

Improve the logging of ACD (address conflict detection) conflict events.

Purpose

At the moment, ACD (address conflict detection) collisions are logged in the journal without the proper metadata. This is a problem because after a connection failure, nmcli suggests to filter the log by using those fields:

$ nmcli connection up veth0+
Error: Connection activation failed: IP configuration could not be reserved (no available address, timeout, etc.)
Hint: use 'journalctl -xe NM_CONNECTION=6c7e9f94-7c87-4744-8527-0c5f50aa6a46 + NM_DEVICE=veth0' to get more details.

However, since the ACD message is emitted by NML3Cfg which is not aware of the current device and connection, the ACD message doesn't have such fields and is not returned by the journalctl command:

# journalctl -xe NM_CONNECTION=6c7e9f94-7c87-4744-8527-0c5f50aa6a46 + NM_DEVICE=veth0
<info> device (veth0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
<info> device (veth0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
<info> device (veth0): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
<warn> device (veth0): Activation: failed for connection 'veth0+'

After this change, the collision message is visible in the filtered log:

# journalctl -xe NM_CONNECTION=6c7e9f94-7c87-4744-8527-0c5f50aa6a46 + NM_DEVICE=veth0
<info> device (veth0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
<info> device (veth0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
<info> device (veth0): IP address 172.25.14.14 cannot be configured because it is already in use in the network by host 00:99:88:77:66:55
<info> device (veth0): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
<warn> device (veth0): Activation: failed for connection 'veth0+'

Merge request reports