Bug 1983735

Summary: Wi-Fi in GNOME shell System Menu is showing connected when it is disconnected.
Product: Red Hat Enterprise Linux 9 Reporter: Filip Pokryvka <fpokryvk>
Component: NetworkManagerAssignee: Beniamino Galvani <bgalvani>
Status: CLOSED ERRATA QA Contact: Filip Pokryvka <fpokryvk>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: bgalvani, fmuellner, jadahl, lrintel, mcatanza, rkhan, sukulkar, thaller, till, tpelka
Target Milestone: betaKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: NetworkManager-1.36.0-0.7.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1983747 (view as bug list) Environment:
Last Closed: 2022-05-17 15:48:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1983747    
Attachments:
Description Flags
journal log of the machine (with NetworkManager trace logs enabled) none

Description Filip Pokryvka 2021-07-19 16:03:17 UTC
Created attachment 1803373 [details]
journal log of the machine (with NetworkManager trace logs enabled)

Created attachment 1803373 [details]
journal log of the machine (with NetworkManager trace logs enabled)

Description of problem:
When disconnecting from Wi-Fi by removing NetworkManager profile (via `nmcli con delete ...` or "forget connection" in gnome-control-center), System Menu in GNOME shell states "Wi-Fi not connected", however in few seconds System mMenu shows Wi-Fi as connected again. NetworkManager did not activate the profile and no Wi-Fi profile is shown as "Connected" in gnome-control-center either.

Version-Release number of selected component (if applicable):
gnome-shell-40.2-1.el9.x86_64
NetworkManager-1.33.1-28790.copr.34b499f1ef.fc34

How reproducible:
always

Steps to Reproduce:
1. Connect to Wi-Fi Network, check Wi-Fi SSID is visible in System Menu
2. Disconnect from Wi-Fi Network (forget connection in gnome-control-center)
3. Open System Menu

Actual results:
In few seconds old Wi-Fi name shows up

Expected results:
"Wi-Fi not connected" should stay there

Additional info:
Even in "Select Network" dialog the connection seems active, even when it is not.

Video:
http://file.brq.redhat.com/~fpokryvk/el9_wifi.webm

Our gnome-shell gating tests started to fail now because of this issue.

Comment 1 Filip Pokryvka 2021-10-14 07:09:25 UTC
I have noticed that my phycial Wi-Fi card in laptop (Intel Wireless 8265 / 8275 rev 78) does not seem to be affected (Wi-Fi stays disconnected in gnome-shell). Our tests use mac80211_hwsim kernel module, which might cause this. But, maybe also other wi-fi drivers cause this bug, so it is worth investigating.

Comment 2 Michael Catanzaro 2021-10-18 18:35:14 UTC
Tomas Pelka noticed this is probably caused by bug #2014624.

Comment 3 Florian Müllner 2021-10-19 15:08:24 UTC
Is this really likely? gnome-shell uses NetworkManager's own libnm to talk with the service, not GNetworkMonitor or direct D-Bus calls.

Comment 4 Michael Catanzaro 2021-10-19 15:30:57 UTC
In that case, not so likely!

Comment 5 Filip Pokryvka 2021-12-06 08:10:00 UTC
I have noticed this started to happened around the same time with RHEL8 and RHEL9, so it is possible it is NetworkManager related, or some commit that was added to both gnome-shell versions at the same time (not sure if that happens). Can you please describe me libnm call that gnome-shell uses (i.e. on which objects which methods are called), so I can check if it is NetworkManager issue (and switch component accordingly)? I would like to sort this out, is is annoying in our testsuite. Thank you!

Comment 6 Florian Müllner 2021-12-10 16:16:12 UTC
The relevant API both for the menu item and the wireless dialog is `NMDeviceWifi:active-access-point`. Likewise in both cases, changes are monitored via `notify::active-access-point`.

Comment 7 Filip Pokryvka 2022-01-26 12:52:46 UTC
After digging into it, wpa_suplicant emits the source signal, and NMDevice just blindly emits it too. So, switchinng component to NetworkManager.

Here is the log with `busctl monitor` and journal (it is on rhel8, but same issue): http://file.brq.redhat.com/~fpokryvk/BZ/report_wpa2.html

Comment 8 Beniamino Galvani 2022-01-26 16:06:10 UTC
This seems caused by a bug in wpa_supplicant, introduced in commit:

https://w1.fi/cgit/hostap/commit/?id=ad2f0966098a8c01ad08959606111a0360fb998d

Anyway, I believe NM should not blindly notify a non-empty ActiveAccessPoint when it's clearly wrong (for example when the device is disconnected).

Comment 9 Beniamino Galvani 2022-01-27 04:27:14 UTC
The bug is that NM doesn't properly clear the CurrentBSS property when wpa_supplicant signals an update on disconnect.

The wpa_supplicant bug mentioned above only exposes the bug, but seems correct. Before that commit, the BSS list was regenerated on disconnect and thus the CurrentBSS property wrongly stored by NM didn't match any existing BSS object path. After the commit the list is not regenerated, hence the bug.

Comment 10 Thomas Haller 2022-01-27 19:30:31 UTC
(In reply to Beniamino Galvani from comment #8)
> This seems caused by a bug in wpa_supplicant, introduced in commit:
> 
> https://w1.fi/cgit/hostap/commit/?id=ad2f0966098a8c01ad08959606111a0360fb998d

What exactly is the bug there? Is there a fix?

Is that really related to this bug?


I actually failed to reproduce this bug (the g-c-c video). Dunno what I did wrong.
But from code review, it's no doubt that the patch fixes a bug and something that was never intended this way.
Setting "Tested".

Comment 11 Filip Pokryvka 2022-01-27 19:37:46 UTC
Hi Thomas,

please see original video, what the bug looks like: 

http://file.brq.redhat.com/~fpokryvk/el9_wifi.webm

The problem is GNOME shell thinks it is connected to open, and it even does not allow to connect to open when selecting network.

The second video was just to gather journal logs together with `busctl monitor` output.

Comment 17 errata-xmlrpc 2022-05-17 15:48:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: NetworkManager), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:3915