Timed out waiting for device /subsystem/net/devices/wlan0

Bug #1906646 reported by Juerg Haefliger
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Netplan
Confirmed
Undecided
Unassigned
netplan.io (Ubuntu)
Triaged
High
Unassigned
Focal
Confirmed
Undecided
Unassigned
Groovy
Won't Fix
Undecided
Unassigned

Bug Description

I've added the following netplan yaml to a Raspberry Pi classic (groovy and focal) image:

network:
  wifis:
    wlan0:
      dhcp4: true
      optional: true
      access-points:
        "<ssid>":
          password: "<psk>"

This works fine on a Pi that has a wifi adapter but causes a 1.5 minute boot delay on a Pi 2B. With 'optional: true' that shouldn't happen, or should it?

[ OK ] Finished Wait until snapd is fully seeded.
snapd.seeded.service
[ TIME ] Timed out waiting for device /subsystem/net/devices/wlan0.
[DEPEND] Dependency failed for WPA supplicant for netplan wlan0.
[ OK ] Reached target Network.
[ OK ] Reached target Network is Online.

Revision history for this message
Brian Murray (brian-murray) wrote :

The Groovy Gorilla has reached end of life, so this bug will not be fixed for that release

Changed in netplan.io (Ubuntu Groovy):
status: New → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in netplan.io (Ubuntu Focal):
status: New → Confirmed
Changed in netplan.io (Ubuntu):
status: New → Confirmed
Revision history for this message
Dries Oeyen (driesoeyen) wrote :

This behavior is not rPi-specific and affects Netplan in general. This happens when configuring an optional wifis entry for a Wi-Fi adapter that may not be present at boot, such as a Wi-Fi dongle.

- The following user reported it on Ubuntu Desktop 18.04 and 20.04: https://bugs.launchpad.net/netplan/+bug/1951651 (marked as duplicate)
- I encountered it on Ubuntu Core 20: https://forum.snapcraft.io/t/ubuntu-core-20-boot-delayed-by-missing-wi-fi-usb-dongle-despite-optional-true-netplan-config/27403

I got a promising reply on the Snapcraft forum thread linked above (direct link to the reply: https://forum.snapcraft.io/t/ubuntu-core-20-boot-delayed-by-missing-wi-fi-usb-dongle-despite-optional-true-netplan-config/27403/5). The relevant section is:

> The optional: true is a valid flag, but it only handles the waiting for the network to come up and be configured. The timeout we’re observing here seems to come from the netplan-wpa-wlx0123456789ab.service unit waiting for the sys-subsystem-net-devices-wlx0123456789ab.device hardware to become available, though, but that does not exist if the dongle is unplugged.
>
> According to https://github.com/systemd/systemd/issues/4413 1 we might need to change the Requires=sys-subsystem-net-devices-wlx0123456789ab.device dependency to something like Requisite=sys-subsystem-net-devices-wlx0123456789ab.device (I’m not sure about the side-effects, tho).

There's a reproduction scenario in the original post on the Snapcraft forum as well.

Dries Oeyen (driesoeyen)
Changed in netplan:
status: New → Confirmed
Revision history for this message
Lukas Märdian (slyon) wrote :

Thanks for this investigation! This issue has been discussed in multiple places, like here where a udev rule is recommended: https://github.com/systemd/systemd/issues/2891

I wonder if we could downgrade the "Requires=sys-subsystem-net-devices-XXX.device" to a "Wants=sys-subsystem-net-devices-XXX.device" and add an additional triggering condition on the sysfs path ("ConditionPathExists=|/sys/subsystem/net/devices/XXX"). AFAIU this way the wpa_supplicant unit should fail immediately, if the devices (& its sysfs path) is not there but start as soon as the dongle is plugged in.

https://systemd.network/systemd.unit.html#Conditions%20and%20Asserts

I guess this needs some experimentation to fully understand the side-effects.

Changed in netplan.io (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High
tags: added: jj-rls-incoming
Lukas Märdian (slyon)
tags: added: fr-3792
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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