setup-interfaces doesn't work anymore after entering a non-existent wireless network name
Steps to reproduce:
- Run setup-interfaces, and try to configure wlan0
- When prompted for the wireless network name, write a non-existent network name
- Try to run setup-interfaces again
I noticed that if I make a typo and select a non-existent wireless network, then try to run setup-interfaces again, setup-interfaces will stop working due to a wpa_supplicant issue. This is the output:
Tyoe the wireless network name to connect to: myNetwork Type the "myNetwork" network Pre-Shared Key: <key goes here, echoed thanks to https://bugs.alpinelinux.org/issues/8068> Successfully initialized wpa_supplicant Line 53: invalid key_mgmt 'open' Line 53: no key_mgmt values configured. Line 53: failed to parse key_mgmt 'open' Line 54: failed to parse network block. Failed to read or parse configuration '/etc/wpa_supplicant/wpa_supplicant.conf'
After this, setup-interfaces goes on normally. wlan0, of course, doesn’t work. The only way to fix this is by removing the erroneous wpa_supplicant.conf entry:
... network={ ssid="typo" key_mgmt=open } ...
I noticed that the wpa_supplicant.conf also had all the previous entries generated by running setup-interfaces every time I reboot (thanks to bug https://bugs.alpinelinux.org/issues/8025). I’m marking this as high priority, since it’s an obvious usability bug that affects anyone who might make a typo when selecting the network in setup-interfaces (which, again, has to be done on every reboot).
(from redmine: issue id 8422, created on 2018-01-25)