netplan should allow NICs to be disconnected and not stall the boot

Bug #1619258 reported by Oliver Grawert
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Undecided
Unassigned
nplan (Ubuntu)
Fix Released
High
Mathieu Trudel-Lapierre
systemd (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

in older snappy image we used to set "allow-hotplug" in /etc/network/interfaces.d/ when configuring a NIC to avoid the boot to completely stall or to be stuck for 5min when trying to find an internet connection.

with recent versions of netplan the configuration seems to be back to require a network to be up before moving on with them boot so that booting takes forever until the network connection times out.

netplan should make the system check the physical link status when trying to bring up a network device instead of stalling the boot.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nplan (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

Which services in snappy actually stall/wait on network-online.target? On my yakkety desktop system these are just rc-local.service, kerneloops.service, and lxd.service -- neither of which are really required to log into the device or start services (even ssh.service doesn't block on network-online.target).

So not implementing network-online.target would be a workaround, but I believe eventually this would not help -- as services which *legitimately* need to wait until the network is up (such as network mounts, backup software, etc.) would then unnecessarily fail.

I believe it is a more robust design to always let network-online.target do its job but avoid depending on it in services which don't really require network.

Can you please copy&paste the output of "systemctl list-jobs" when this happens? This should show the bits that wait on network-online.target.

> netplan should make the system check the physical link status when trying to bring up a network device instead of stalling the boot.

Both networkd and NM already do this -- they bring up an interface once it appears and gets a carrier. However, s-n-wait-online waits until all configured links appear (with a timeout of 2 minutes), which is usually what you want with services that depend on network-online.

So I believe completely disabling wait-online is not the right way. We might want to add syntax and functionality to mark devices like "allow-hotplug" in ifupdown, though.

Changed in nplan (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

Ping? Is this still an issue?

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I don't think so.

Revision history for this message
Martin Pitt (pitti) wrote :

OK, thanks. Please reopen with answers to comment #2 if it turns out to still be an issue after all.

Changed in nplan (Ubuntu):
status: Incomplete → Invalid
Changed in snappy:
status: New → Invalid
Oliver Grawert (ogra)
Changed in nplan (Ubuntu):
status: Invalid → Confirmed
Changed in snappy:
status: Invalid → Confirmed
Revision history for this message
Oliver Grawert (ogra) wrote :

setting this back to confirmed

this is definitely still an issue (and always has been), very easily to reproduce on a raspberry pi3 with Ubuntu Core that you only configure for wifi...

if you go with the defaults in the network config of subiquity the eth0 device stays enabled and defaults to dhcp but nothing in systemd will take into account if a physical wire is connected on boot so it will blindly wait for the interface to be up until the timeout hits.

adding something like "allow-hotplug" to nplan would solve this. alternatively simply having systemd-networkd check for physical status and skipping the unwired device would help too.

Revision history for this message
Oliver Grawert (ogra) wrote :

thee is also an example on the snapcraft forum now:

https://forum.snapcraft.io/t/ubuntu-core-16-slow-boot-with-netplan/2057

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1619258] Re: netplan should allow NICs to be disconnected and not stall the boot

Might this also be why the boot is so slow on the server live-install image?

Mark

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Yes, I think it probably is. I want to change the server live-install image
to dhcp on wired interfaces by default which will mostly work around the
problem but a real fix/understanding is clearly also required.

On 12 September 2017 at 04:42, Mark Shuttleworth <<email address hidden>
> wrote:

> Might this also be why the boot is so slow on the server live-install
> image?
>
> Mark
>
> --
> You received this bug notification because you are a member of Snappy
> Developers, which is subscribed to Snappy.
> https://bugs.launchpad.net/bugs/1619258
>
> Title:
> netplan should allow NICs to be disconnected and not stall the boot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snappy/+bug/1619258/+subscriptions
>

tags: added: rls-aa-incoming
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

possibly a bug in systemd-networkd-wait-online

Revision history for this message
Oliver Grawert (ogra) wrote :

Note that this bug is about Ubuntu Core (xenial), i dont think we use systemd-networkd in the rest of xenial ( https://lists.ubuntu.com/archives/ubuntu-devel/2016-January/039066.html )

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Yeah, we're kinda talking about two things, the problem with ubuntu core and the problem with the artful daily-live server installer. Both of those use networkd :) I'm think xnox has a plan for artful, I'm not sure if it will apply to ubuntu core though, maybe he can confirm?

Revision history for this message
Steve Langasek (vorlon) wrote :

The netplan piece of this is being driven via LP: #1664844.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

In progress; we got optional: true for that and systemd has a corresponding "RequiredForOnline=false".

Changed in nplan (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Changed in systemd (Ubuntu):
status: New → Fix Released
Revision history for this message
Daniel Axtens (daxtens) wrote :

This has been in a released version of netplan.io since 0.32. Are we right to mark this as Fix Released for nplan? It looks like LP: #1664844 has been marked as Fix Released too.

Revision history for this message
Oliver Grawert (ogra) wrote :

feel free (i set the snappy task to fix-released too)

Changed in snappy:
status: Confirmed → Fix Released
Revision history for this message
Daniel Axtens (daxtens) wrote :

Thanks, done.

Changed in nplan (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Tyler Bennett (tbennett6421) wrote :

What is the actual fix for this. I have run into this multiple times. Is there a specific edit that needs to be made to the stanza in netplan? After reviewing the netplan docs I was unable to find a corresponding directive for allow-hotplug with /etc/network/interfaces.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

$ sudo dpkg --list | grep netplan
ii libnetplan0:amd64 0.104-0ubuntu2~20.04.1
ii netplan.io 0.104-0ubuntu2~20.04.1

```yaml
network:
  ethernets:
    eno1:
      dhcp4: true
    eno2:
      dhcp4: true
    eno3:
      dhcp4: true
    eno4:
      dhcp4: true
    enp130s0:
      dhcp4: true
    enp130s0d1:
      dhcp4: true
    enp134s0f0:
      dhcp4: true
    enp134s0f1:
      dhcp4: true
    enp135s0f0:
      dhcp4: true
    enp135s0f1:
      dhcp4: true
  version: 2
```

Revision history for this message
Lukas Märdian (slyon) wrote :

@tbennett6421 Yes, please make use of the "optional: true" stanza in your interface definitions.

https://netplan.io/reference/#common-properties-for-all-device-types

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

Other bug subscribers

Remote bug watches

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