[wifi-ap] AP is not re-established after a reboot

Bug #1758342 reported by Alfonso Sanchez-Beato on 2018-03-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snappy-hwe-snaps
High
Alfonso Sanchez-Beato

Bug Description

An AP created with "sudo wifi-ap.setup-wizard" is not re-established after a reboot. network-manager retakes control of the wlan device, and hostapd is not running. Seen in caracalla and other devices.

This happens not only on reboots, but also when NM re-starts. Therefore, this will happen also when there is an NM snap update.

admin@1234567:~$ snap services wifi-ap
Snap Service Startup Current
wifi-ap automatic-setup enabled inactive
wifi-ap management-service enabled active

admin@1234567:~$ ps -ef|grep hostapd
admin 5036 4949 0 13:52 pts/0 00:00:00 grep --color=auto hostapd

admin@1234567:~$ network-manager.nmcli d
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected Wired connection 1
wlan0 wifi disconnected --
lo loopback unmanaged --

admin@1234567:~$ snap list
Name Version Rev Developer Notes
alsa-utils 1.1.2-5 68 canonical -
bluez 5.44-3 129 canonical -
caracalla 16.04-1.35 49 canonical gadget
caracalla-kernel 4.4.0-116.140-1 77 canonical kernel
core 16-2.31.2 4206 canonical core
locationd 4.2.1 163 canonical -
modem-manager 1.6.12-1 120 canonical -
network-manager 1.2.2-15-dev x1 -
snapweb 0.26-11 319 canonical -
tpm2 1.0-5 42 canonical -
udisks2 2.6.4-2 100 canonical -
uefi-fw-tools 1.5.2-0.7.2+git 10 canonical -
wifi-ap 17 204 canonical -
wpa-supplicant 2.4.3 41 canonical -

Related branches

Changed in snappy-hwe-snaps:
importance: Undecided → High

It turns out that this is a race condition that happens when the wifi-ap management service starts before NetworkManager. In that case, when wifi-ap tries to set the wifi interface as "unmanaged" in NM by using nmcli, NM is not yet there. In the moment NM starts, it takes control of the wifi interface and hostapd dies. See attached log. Interesting traces:

Mar 23 16:18:21 1234567 wifi-ap.management-service[3461]: Error: NetworkManager is not running.
Mar 23 16:18:22 1234567 NetworkManager[3455]: <info> [1521821902.6045] NetworkManager (version 1.2.2) is starting...

And when things are good:

Mar 23 16:35:10 1234567 NetworkManager[3469]: <info> [1521822910.8624] NetworkManager (version 1.2.2) is starting...
Mar 23 16:35:12 1234567 wifi-ap.management-service[3465]: + nm_status=running

description: updated
Changed in snappy-hwe-snaps:
status: New → In Progress
assignee: nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato)
Jim Hodapp (jhodapp) wrote :

@Alfonso: was the fix ever released, is this bug report just out of date?

@Jim it has been released to the stable channel. It is just that lp does not track that. Set to released now.

Changed in snappy-hwe-snaps:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments