sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
706 stars 1.35k forks source link

[systemd/systemd-sonic-generator] Introduction of networkd causes error log message "Timeout occurred while waiting for network connectivity" #19058

Open gpunathilell opened 1 month ago

gpunathilell commented 1 month ago

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:

  1. Use sonic on a switch which has no interfaces managed by networkd
  2. systemctl start apt-daily.service or systemctl start apt-daily-upgrade.service
  3. 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 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):

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

dgsudharsan commented 1 month ago

@Pterosaur @prgeor Can you please check this issue?

Pterosaur commented 2 days ago

Hi @dgsudharsan @gpunathilell , could you please help to review this fix: https://github.com/sonic-net/sonic-buildimage/pull/19107