After the introduction of networkd in the sonic-buildimage repository in #18178, when apt-daily.service and apt-daily-upgrade.service are running we get a error log message after 30 seconds:
ERR systemd-networkd-wait-online[50532]: Timeout occurred while waiting for network connectivity
This is due to the
ExecStartPre=-/usr/lib/apt/apt-helper wait-online
in both apt-daily.service and apt-daily-upgrade.service. In non-smartswitch systems since we do not have any interfaces managed by networkd, the apt-helper call for wait-online times out after 30 seconds (https://salsa.debian.org/apt-team/apt/-/blob/main/cmdline/apt-helper.cc#L227) and an error log is generated.
Steps to reproduce the issue:
Use sonic on a switch which has no interfaces managed by networkd
systemctl start apt-daily.service or systemctl start apt-daily-upgrade.service
ERR systemd-networkd-wait-online[50532]: Timeout occurred while waiting for network connectivityINFO apt-helper[11911]: E: Sub-process /lib/systemd/systemd-networkd-wait-online returned an error code (1)
is seen in the syslog after 30 seconds
Describe the results you expected:
No errors in the logs
Output of show version:
(paste your output here)
Output of show techsupport:
(paste your output here or download and attach the file here )
Additional information you deem important (e.g. issue happens only occasionally):
Description
After the introduction of networkd in the sonic-buildimage repository in #18178, when apt-daily.service and apt-daily-upgrade.service are running we get a error log message after 30 seconds:
ERR systemd-networkd-wait-online[50532]: Timeout occurred while waiting for network connectivity
This is due to the
ExecStartPre=-/usr/lib/apt/apt-helper wait-online
in both apt-daily.service and apt-daily-upgrade.service. In non-smartswitch systems since we do not have any interfaces managed by networkd, the apt-helper call for wait-online times out after 30 seconds (https://salsa.debian.org/apt-team/apt/-/blob/main/cmdline/apt-helper.cc#L227) and an error log is generated.Steps to reproduce the issue:
systemctl start apt-daily.service
orsystemctl start apt-daily-upgrade.service
tail -f /var/log/syslog | grep systemd-networkd-wait-online
Describe the results you received:
ERR systemd-networkd-wait-online[50532]: Timeout occurred while waiting for network connectivity
INFO apt-helper[11911]: E: Sub-process /lib/systemd/systemd-networkd-wait-online returned an error code (1)
is seen in the syslog after 30 secondsDescribe the results you expected:
No errors in the logs
Output of
show version
:Output of
show techsupport
:Additional information you deem important (e.g. issue happens only occasionally):
systemd-networkd-wait-online times out and adds an error log if no interfaces are managed by networkd : https://github.com/systemd/systemd/blob/c09f7e5a8208fab5680bfeba8df5707887a8c080/src/network/wait-online/manager.c#L205 Further information regarding this behaviour: https://www.github.com/systemd/systemd/issues/27822