← Back to team overview

debcrafters-packages team mailing list archive

[Bug 2063973] Re: network-online.target is reached before netplan-configured interfaces are online

 

In case it help others - I had the same root cause issue with a slightly
different setup. I was using link files placed at /etc/systemd/network
to rename my adapters, and it caused the same problem. For example, I
had /etc/systemd/network/10-en_public.link with contents like:

[Match]
MACAddress=xx:xx:xx:xx:xx:xx

[Link]
Name=en_public

And this would cause the same issue as the udev rule renaming method.
I'd get the same error message "Wait for Network to be Configured was
skipped..." for the same reason, though in my scenario, I'm not sure the
generator file was ever created. Switching to use the netplan match like
suggested, including the set-name property, fixed the problem and kept
my adapters with the desired names.

Note that the id used as the key in the ethernets dict in the yaml is
not used to set the interface name and does not have to match the
original interface name when you use the match property. Instead, you
can just set the key to something unique (e.g. "my_adapter_id_0" and
then use set-name to actually set the adapter name. The key will just be
used for the link/network files created at /run/systemd/network. See
https://netplan.readthedocs.io/en/latest/netplan-yaml/

-- 
You received this bug notification because you are a member of
Debcrafters packages, which is subscribed to netplan.io in Ubuntu.
https://bugs.launchpad.net/bugs/2063973

Title:
  network-online.target is reached before netplan-configured interfaces
  are online

Status in netplan.io package in Ubuntu:
  Fix Released

Bug description:
  Hi,

  Running Ubuntu 24.04 with netplan.io/netplan-generator 1.0-2ubuntu1.

  I use a systemd unit to mount an NFS filesystem. That unit should only
  be activated when the network is ready. However, it looks like
  network-online.target is reached before netplan-configured interfaces
  are up, so the unit triggers too early and sometimes fail (because it
  cannot resolve the name of the remote server).

  I configured netplan manually with:
  ```
  # cat /etc/netplan/01-netcfg.yaml 
  ---
  network:
    version: 2
    renderer: networkd
    ethernets:
      eno1:
        dhcp4: true
  ```

  I see the following during boot:

  ```
  Apr 27 23:31:28 localhost systemd[1]: Starting systemd-networkd.service - Network Configuration...
  Apr 27 23:31:28 localhost systemd-networkd[1190]: lo: Link UP
  Apr 27 23:31:28 localhost systemd-networkd[1190]: lo: Gained carrier
  Apr 27 23:31:28 localhost systemd-networkd[1190]: Enumeration completed
  Apr 27 23:31:28 localhost systemd-networkd[1190]: eno1: Configuring with /run/systemd/network/10-netplan-eno1.network.
  Apr 27 23:31:28 localhost systemd[1]: Started systemd-networkd.service - Network Configuration.
  Apr 27 23:31:28 localhost systemd[1]: Reached target network.target - Network.
  Apr 27 23:31:28 localhost systemd[1]: systemd-networkd-wait-online.service - Wait for Network to be Configured was skipped because of an unmet condition check (ConditionPathIsSymbolicLink=/run/systemd/generator/network-online.target.wants/systemd-networkd-wait-online.service).
  Apr 27 23:31:28 localhost systemd[1]: Reached target network-online.target - Network is Online.
  Apr 27 23:31:28 localhost systemd[1]: Reached target remote-fs-pre.target - Preparation for Remote File Systems.
  Apr 27 23:31:28 localhost systemd[1]: Mounting grid5000.mount - /grid5000...
  Apr 27 23:31:28 localhost systemd-networkd[1190]: eno1: Link UP
  Apr 27 23:31:28 localhost systemd-networkd[1190]: eno1: Gained carrier
  Apr 27 23:31:28 localhost systemd-networkd[1190]: eno1: DHCPv4 address 172.16.66.53/20, gateway 172.16.79.254 acquired from 172.16.79.107
  Apr 27 23:31:28 localhost systemd[1]: Starting networkd-dispatcher.service - Dispatcher daemon for systemd-networkd...
  Apr 27 23:31:29 gros-53 systemd[1]: Starting rpc-statd.service - NFS status monitor for NFSv2/3 locking....
  Apr 27 23:31:29 gros-53 rpc.statd[1439]: Version 2.6.4 starting
  Apr 27 23:31:29 gros-53 rpc.statd[1439]: Flags: TI-RPC
  Apr 27 23:31:29 gros-53 rpc.statd[1439]: Failed to read /var/lib/nfs/state: Success
  Apr 27 23:31:29 gros-53 rpc.statd[1439]: Initializing NSM state
  Apr 27 23:31:29 gros-53 systemd[1]: Started rpc-statd.service - NFS status monitor for NFSv2/3 locking..
  Apr 27 23:31:29 gros-53 mount[1441]: Created symlink /run/systemd/system/remote-fs.target.wants/rpc-statd.service → /usr/lib/systemd/system/rpc-statd.service.
  Apr 27 23:31:29 gros-53 systemd[1]: Reloading requested from client PID 1441 ('systemctl') (unit grid5000.mount)...
  Apr 27 23:31:29 gros-53 systemd[1]: Reloading...
  Apr 27 23:31:30 gros-53 systemd[1]: Reloading finished in 194 ms.
  Apr 27 23:31:30 gros-53 systemd[1]: Mounted grid5000.mount - /grid5000.
  Apr 27 23:31:30 gros-53 nfsrahead[1497]: setting /grid5000 readahead to 128

  
  The key message here seems to be:
  Apr 27 23:31:28 localhost systemd[1]: systemd-networkd-wait-online.service - Wait for Network to be Configured was skipped because of an unmet condition check (ConditionPathIsSymbolicLink=/run/systemd/generator/network-online.target.wants/systemd-networkd-wait-online.service).
  Why doesn't netplan generate that symlink? It seems it does generate it, but only later, when systemd reloads at 23:31:29 (according to 'stat' on the symlink).

  
  It worked fine with Ubuntu 22.04:
  "systemd[1]: Reached target Network is Online."
  only appears after the interface got configured via DHCP.

  ProblemType: Bug
  DistroRelease: Ubuntu 24.04
  Package: netplan.io 1.0-2ubuntu1
  ProcVersionSignature: Ubuntu 6.8.0-31.31-generic 6.8.1
  Uname: Linux 6.8.0-31-generic x86_64
  ApportVersion: 2.28.1-0ubuntu2
  Architecture: amd64
  CasperMD5CheckResult: pass
  Date: Sat Apr 27 23:50:37 2024
  InstallationDate: Installed on 2024-04-26 (1 days ago)
  InstallationMedia: Ubuntu-Server 24.04 LTS "Noble Numbat" - Release amd64 (20240423)
  ProcEnviron:
   LANG=en_US.UTF-8
   PATH=(custom, no user)
   SHELL=/bin/bash
   TERM=xterm
   XDG_RUNTIME_DIR=<set>
  SourcePackage: netplan.io
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2063973/+subscriptions