systemd-networkd-wait-online waits when devices are unmanaged

Bug #1728181 reported by Mathieu Trudel-Lapierre on 2017-10-28
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Undecided
Dimitri John Ledkov
Bionic
Undecided
Dimitri John Ledkov

Bug Description

I started a system with cloud-init disabled, etc. and a single real network interface (ens3) that could be configured.

That VM has no configuration whatsoever for systemd-networkd, as that would have to have been written by netplan, and cloud-init did not generate netplan config (because it was disabled).

So:

root@ubuntu:/etc/systemd/system/network-online.target.wants# ip route
d-networkd-wait-online --ignore=lo
ignoring: lo
Event loop failed: Connection timed out
root@ubuntu:/etc/systemd/system/network-online.target.wants# ip route
root@ubuntu:/etc/systemd/system/network-online.target.wants# networkctl
IDX LINK TYPE OPERATIONAL SETUP
  1 lo loopback carrier unmanaged
  2 ens3 ether off unmanaged
  3 sit0 sit off unmanaged

3 links listed.
root@ubuntu:/etc/systemd/system/network-online.target.wants#

The system took 120 seconds to complete boot, because wait-online had to finish; and running wait-online from the system afterwards also waits 120 seconds (its default timeout). If there is no configuration for an interface, it's unmanaged (as shown by networkctl), so wait-online should not wait, and simply report that all interfaces are unmanaged, possibly returning an error so we don't reach network-online.

FWIW, having wait-online look up configuration might later be useful also to figure out if an interface was configured, but marked as optional (such that it is explicitly not required to be up at boot), or if we want to configure network devices but specify that networkd should *not* bring them online (like "administratively disabled" interfaces in Cisco world using the "shutdown" command).

Scott Moser (smoser) on 2017-10-28
Changed in systemd (Ubuntu):
status: New → Confirmed
Scott Moser (smoser) wrote :

Essentially we are looking for this work flow to function, with or without
network devices attached to the system.

$ wget http://cloud-images.ubuntu.com/some-disk.img
$ qemu-img create -f qcow2 -b some-disk.img my-disk.img
$ sudo ~/bin/backdoor-image my-disk.img --user=user1 --password=passw0rd1
$ qemu-system-x86_64 -enable-kvm \
  -device virtio-scsi-pci,id=virtio-scsi-xkvm \
  -drive file=my.img,id=disk00,if=none,format=qcow2,index=0 \
  -device virtio-blk,drive=disk00,serial=my.img \
  -m 768 -nodefaults -nographic -serial mon:stdio -echr 0x05
....

then just login at prompt with 'user1' and 'password1'

That does generally work right now, it just has a 120 second-ish timeout
on waiting for network devices that configured (and possibly even are
not present) to come up.

  http://paste.ubuntu.com/25833773/

Metta Crawler (metta-crawler) wrote :

This morning I found out that if I boot
linux-image-4.13.0-17-generic
I get a hang at
Nov 23 07:12:47 lakshmi NetworkManager[1795]: <info> [1511439167.0455] manager: rfkill: WWAN hardware radio set enabled
Nov 23 07:14:30 lakshmi systemd-networkd-wait-online[1454]: Event loop failed: Connection timed out

But if I boot
linux-image-4.14.2-041402-generic
there is no two minute delay.

Metta Crawler (metta-crawler) wrote :

I'm not using cloud-init. My network devices are not managed because I disabled NetworkManager.service shortly after installing 17.10 on bare metal Nov 5, 2017 9:44 AM EDT. I think there were too many fires then and I didn't want to try to convince NetworkManager to use a bridge. I just lived with the two minute delay while working on the four minute delay LP 1731566
and the "BUG: unable to handle kernel NULL pointer dereference at (null)" LP 1730374 until work on that last issue lead to the two minute delay clearing up as a side-effect.

Metta Crawler (metta-crawler) wrote :

This bug may be a duplicate of LP #1717152

dino99 (9d9) wrote :

An other case: get the same issue via a netboot install ( lp:1736880 )
I get a 'Wired unmanaged" into dropdown menu

Changed in systemd (Ubuntu Bionic):
assignee: nobody → Dimitri John Ledkov (xnox)
milestone: none → ubuntu-18.03
Changed in systemd (Ubuntu Bionic):
status: Confirmed → Fix Committed
tags: added: id-5ab94d247a8174c33895ec21
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 237-3ubuntu6

---------------
systemd (237-3ubuntu6) bionic; urgency=medium

  * Adjust the new dropin test, for v237 systemd.
  * Refresh the keyring patch, to the one merged.

 -- Dimitri John Ledkov <email address hidden> Tue, 27 Mar 2018 13:40:09 +0100

Changed in systemd (Ubuntu Bionic):
status: Fix Committed → Fix Released
dino99 (9d9) wrote :

This is still not fixed on bionic

dbus-daemon[1299]: [session uid=1000 pid=1299] Activating service name='org.gnome.Identity' requested by ':1.39' (uid=1000 pid=1524 comm="/usr/lib/gnome-online-accounts/goa-daemon " label="unconfined")

systemd-networkd-wait-online[771]: Event loop failed: Connection timed out

systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE

systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'.

Dimitri John Ledkov (xnox) wrote :

@dino99

Please specify version of systemd installed, e.g. $ dpkg -l systemd

Please attach the output of $ networkctl

Denis Genov (denisgenov) wrote :

I face the same issue

> # dpkg -l systemd
> ...
> ||/ Name Version Architecture Description
> +++-==========-==================-===============-==========================
> ii systemd 237-3ubuntu10.3 amd64 system and service manager

> # networkctl
> IDX LINK TYPE OPERATIONAL SETUP
> 1 lo loopback carrier unmanaged
> 2 ens3 ether routable configuring
> 3 ens4 ether routable unmanaged

> Aug 03 14:00:53 test-vm systemd-networkd-wait-online[4273]: Event loop failed: Connection timed out

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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