Community Packages

Please read this before reporting a bug:
http://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#63912 - [iwd] Restart of iwd.service necessary after boot

Attached to Project: Community Packages
Opened by Daniel Holz (holzi) - Tuesday, 24 September 2019, 19:56 GMT
Last edited by David Runge (dvzrv) - Sunday, 03 November 2019, 11:19 GMT
Task Type Bug Report
Category Packages
Status Assigned
Assigned To Christian Rebischke (Shibumi)
Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 7
Private No

Details

When I boot up my computer after logging in I have to restart iwd.service or wifi won't work. After that it works mostly fine.

Attached is the status of iwd.service before restarting it.
   iwd.txt (1.2 KiB)
This task depends upon

Comment by AMM (amish) - Friday, 18 October 2019, 01:04 GMT
I am having same issue from long now. But did not report thinking that iwd is still under development and decided to wait for few more months.
Comment by Nick (yonson) - Friday, 18 October 2019, 17:03 GMT
I am attempting to run a relatively minimal networking stack, with just dhcpd and iwd. I am using the "use_default_interface=true" setting in iwd to try and keep things simple. But iwd never lists any devices after boot and I have to bounce it. Is there a race condition happening on boot where iwd does not detect the physical device?
Comment by Daniel Holz (holzi) - Sunday, 03 November 2019, 13:44 GMT
Since the release of iwd 1.0 the problem does not appear anymore on my system.
Comment by Christian Rebischke (Shibumi) - Sunday, 03 November 2019, 14:36 GMT
AMM and Nick can you confirm that the bug is vanished?
Comment by Nick (yonson) - Sunday, 03 November 2019, 19:46 GMT
I am still having to restart the service, don't see anything new in the system logs.
Comment by AMM (amish) - Monday, 04 November 2019, 01:10 GMT
Nope. I still need to restart the service.
Comment by Christian Rebischke (Shibumi) - Monday, 04 November 2019, 17:55 GMT
Hi,
did you guys try to report this on #iwd in freenode? I am using iwd as well and I don't have such issues.

Are you using plain IWD or IWD+Networkmanager/Connman?
Comment by Christian Rebischke (Shibumi) - Monday, 04 November 2019, 18:24 GMT
@holz

This looks like a interface race for me, something is interfering with iwd's `wlan0` creation. Did you modify the `/etc/iwd/main.conf` file? or did you setup something else that is owning the wifi device? Maybe another wpa_supplicant running?

More information would be nice here. Is your wifi card in-build or USB? etc
Comment by Parker Reed (parkerlreed) - Monday, 04 November 2019, 18:51 GMT
I believe sometimes iwd is just too fast for even the network adapter itself to load. I added a sleep to the ExecStartPre in the service and now it loads consistently every time.
Comment by Wiktor (wiktor) - Friday, 13 December 2019, 22:31 GMT
I'm also having this issue consistently (that is after each boot) also with iwd 1.3. The only significant log line in journald is "NEW_INTERFACE failed: Device or resource busy". I'm on XPS 13 (9350, Broadcom BCM4350) with just systemd-network without connman/networkmanager etc.

The "iwd too fast" theory sounds plausible as the only working workaround I found is "ExecStartPre=sleep 4" mentioned by Parker. No other method mentioned on Arch Wiki works.

I'll report it upstream when I find a moment (and try digging up the root cause).
Comment by Christian Rebischke (Shibumi) - Sunday, 22 December 2019, 18:15 GMT
How is iwd 1.4? Does it fix the problem?
Comment by Wiktor (wiktor) - Sunday, 22 December 2019, 21:10 GMT
Nope, unfortunately the effect is exactly the same as on 1.3 (I checked 1.3 and then upgraded to 1.4 and re-checked). iwd still requires restart after boot to work or the dummy sleep in ExecStartPre.

I've reported the issue upstream: https://lists.01.org/hyperkitty/list/iwd%40lists.01.org/thread/L5OXQ52CQCO2WAYUKOSZZHH6QR4UMQKB/
Comment by Christian Rebischke (Shibumi) - Sunday, 22 December 2019, 21:47 GMT
Hi Wiktor, are you using a daemon for mining entropy like haveged? It's known that iwd doesn't function properly without proper entropy. This maybe explain your issues.

Otherwise:

Please provide iwmon logs, driver, kernel and hw details..
Comment by Wiktor (wiktor) - Monday, 23 December 2019, 08:43 GMT
Nope, I'm not using haveged but this is a good lead. I'll get back with results.
Comment by Kim, DoHyung (dynaxis) - Friday, 27 December 2019, 08:03 GMT
I reported the same issue to the forum: https://bbs.archlinux.org/viewtopic.php?id=251432

There are some logs I provided. And as you can read there, the issue seems already brought to freenode #iwd.
I'm too working around the problem by adding ExecStartPre=sleep 2. So guess it's kinda race condition.
Comment by Andrew Zaborowski (balrog) - Tuesday, 28 January 2020, 21:48 GMT
I think most of the reports here and in the forums thread refer to a race condition iwd had when using brcmfmac. The recent commit 55f9639ee37cfca0590cba58f7d58b5c57749a10 in iwd git attempts to fix this, please test.
Comment by Kim, DoHyung (dynaxis) - Wednesday, 29 January 2020, 12:17 GMT
Hi Andrew,

Are you planning to make another release including the commit soon?
Then I'll wait and try when it's available through pacman.

Otherwise, I'll try it by modifying an existing AUR or building new one by myself.

Thanks.
Comment by Kim, DoHyung (dynaxis) - Wednesday, 29 January 2020, 13:38 GMT
Comment by Christian Rebischke (Shibumi) - Wednesday, 29 January 2020, 17:07 GMT
Hi,
please checkout the iwd-git version in the AUR: https://aur.archlinux.org/packages/iwd-git/

I've updated the PKGBUILD. It should build iwd with the same features as in community now. I hope it will fix your issues. I am running iwd-git right now, works fine for me.
Comment by Kim, DoHyung (dynaxis) - Thursday, 30 January 2020, 01:36 GMT
Hi Christian,

I tried your AUR and the commit Andrew mentioned above doesn't seem to work.
I'm reverting back to the community package and sleep 2 workaround.


Comment by Christian Rebischke (Shibumi) - Thursday, 30 January 2020, 16:44 GMT
Hi Kim,
the iwd devs need more input. Can you upload the output of `lspci -k` for me?
denkenz (one of the iwd devs) mentioned in IRC that the bug is not yet fixed for ath10k and ath9k drivers/chipsets.. maybe you are affected.
Comment by Kim, DoHyung (dynaxis) - Sunday, 02 February 2020, 06:28 GMT
Hi Christian,

Attached please find the output from `lspci -k`.
   pcis (3.8 KiB)
Comment by Christian Rebischke (Shibumi) - Sunday, 02 February 2020, 13:11 GMT
Hi Kim,
thanks for your pcis file.
Your file meets my expectations.. you are using an ath10k card for wifi.
The bug still exists for ath9k and ath10k. I hope the iwd devs are going to fix this asap.
Comment by Andrew Zaborowski (balrog) - Sunday, 02 February 2020, 20:46 GMT
That's right, I was going to propose a patch here but didn't have the time to do it yet.

Denis noticed, based on the logs posted in the forum thread (https://bbs.archlinux.org/viewtopic.php?id=251432) that we're hitting a kernel bug where the NEW_WIPHY event is not emitted because it's too big specifically when using the ath10k driver, so we need to work around it in iwd. Ironically Denis has previously proposed a kernel patch to fix this but it was never accepted.
Comment by Kim, DoHyung (dynaxis) - Tuesday, 04 February 2020, 05:45 GMT
It's unfortunate that the kernel patch was not accepted. Anyway the forum thread was opened by me. So if you need more information, please let me know. Thanks for the efforts.
Comment by Christian Rebischke (Shibumi) - Tuesday, 04 February 2020, 21:40 GMT
Kim,
can you please try the iwd-git version again? Denkenz, one of the iwd devs, just pushed a possible fix and he needs somebody who tries it.
Would be cool if you could give some feedback.
Comment by Desmond (arch-user) - Tuesday, 04 February 2020, 22:30 GMT
I had same issue and found this bug report.
Tested iwd-git and WiFi works after boot without having to restart iwd.

Hope this version will be in the community repo soon.

Edit: Maybe I should mention that I have a Intel AX200 WiFi card.
Comment by Christian Rebischke (Shibumi) - Wednesday, 05 February 2020, 00:13 GMT
@desmond

isn't Intel AX200 using iwlwifi? everything should be fine with iwlwifi..
Can you upload your output of `lspci`?
Comment by Desmond (arch-user) - Wednesday, 05 February 2020, 16:39 GMT
Yes it is using iwlwifi, but it is not fine for me.

05:00.0 Network controller: Intel Corporation Wi-Fi 6 AX200 (rev 1a)
Subsystem: Intel Corporation Wi-Fi 6 AX200
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi

I was running Arch Budgie with NetworkManager and wpa_supplicant and everything was fine.

Decided to reinstall Arch and test Gnome with NetworkManager and iwd. Configured NM to use iwd backend, started iwd and nm services, at first I thought that I didn't configure nm correctly, noticed that iwd didn't list any devices so I knew that something else was wrong but I didn't realize that the service didn't start at boot before I saw this bug report so I restarted the service and WiFi was working. With git version it works on every boot as expected.
Comment by Kim, DoHyung (dynaxis) - Wednesday, 05 February 2020, 19:38 GMT
Dear Christian,

I tried iwd-git and it works perfectly. I've removed the sleep 2 workaround and rebooted several times. AND there was no single failure in detecting my wireless LAN device.

Thank you and the team working on iwd for the efforts.

I'll stay with iwd-git for the time being until the community package is released with the relevant fix.
Comment by Christian Rebischke (Shibumi) - Wednesday, 05 February 2020, 20:45 GMT
Awesome,
I will ask the iwd devs for a new release.
Comment by Denis Sheremet (lesf0) - Thursday, 06 February 2020, 05:07 GMT
Bug still affects me on fresh `iwd-git` package. `sleep 2` workaround also does not help. Manual restart after successful boot helps.
I'm using iwd as networkmanager backend.
Dmesg and journalctl in attachment.

```
03:00.0 Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)
```
   iwd.log (1.7 KiB)
   dmesg.log (104.9 KiB)
Comment by Christian Rebischke (Shibumi) - Friday, 07 February 2020, 09:55 GMT
Hi Denis,
Can you modify the iwd service file like this?

systemctl edit iwd.service

[Service]
ExecStart=
ExecStart=/usr/lib/iwd/iwd -d


This will turn on debug mode for iwd. And we can see more logs.
Comment by Denis Sheremet (lesf0) - Monday, 10 February 2020, 05:25 GMT
Seems like `iwd-git` fixed the problem somehow. I've got the error reproduced only once after upgrading to it, after that it started to work. Will post an update if error wil occur again.
Comment by Christian Rebischke (Shibumi) - Monday, 10 February 2020, 08:05 GMT
Hi,
did you guys checkout iwd-1.5? I have just pushed it yesterday to community, it should fix the problems for people with brcmfmac or atheros chipsets. (Maybe for newer Intel cards, too).
Comment by Kim, DoHyung (dynaxis) - Monday, 10 February 2020, 14:00 GMT
Thank you, Christian.

I moved back to the community version and it works fine as expected.
Comment by Desmond (arch-user) - Monday, 10 February 2020, 18:13 GMT
Community version works fine for me too. Thx.
I don't think that my case was specific, I guess that more Intel cards were affected too.
Comment by Denis Sheremet (lesf0) - Thursday, 20 February 2020, 04:13 GMT
Error still occurs from time to time on iwd-git. Log with -d flag in attachment, I personally don't see no useful data there.

ip a looks like this:

4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 40:a3:cc:21:92:2e brd ff:ff:ff:ff:ff:ff

(UP, no IP address assigned)

In NetwotkManager there's no wifi device visible
   iwd.log (7.8 KiB)
Comment by Denis Sheremet (lesf0) - Thursday, 20 February 2020, 04:17 GMT
Sorry, wrong log. There is complete log since start of service until I've restarted it
   iwd.log (36.2 KiB)
Comment by Christian Rebischke (Shibumi) - Saturday, 22 February 2020, 12:49 GMT
If the device is connected to the wifi but no IP is assigned it's clearly related to networkmanager or systemd-networkd (DHCP) instead of wifi connection.
I am not sure if we are talking about the same issue here right now.

I have in general the feeling that this bug report is a collection of different problems:

1. problems with atheros devices
2. problems with new intel wifi cards
3. problem with bfmac devices
4. other interface race conditions

@lesf0 can you please provide more logs like:

1. kernel version
2. lspci output
3. iwd with debugging flag (edit your iwd.service file like mentioned in this bug report)
4. iwd devs might need a wifi pcap trace via iwmon

Loading...