cosmic-applets icon indicating copy to clipboard operation
cosmic-applets copied to clipboard

Network applet doesn't work

Open fulalas opened this issue 1 year ago • 16 comments

What are the requirements for the network applet to work?

Currently I can see the icon in the panel and click on it, but the wifi toggle doesn't do anything, I can't see any network available, etc. Nothing shows in the terminal. Using NetworkManager terminal applications work though.

Built from epoch on PorteuX (Slackware based) which has no systemd.

fulalas avatar Aug 11 '24 16:08 fulalas

May be helpful to share the network card and any kernel logs relevant to it.

mmstick avatar Aug 12 '24 18:08 mmstick

I don't think this is kernel related. If I boot into any other DE it works, including DEs using the original nm-applet.

Is it possible this is issue is happening because cosmic-settings-daemon is not running?

fulalas avatar Aug 12 '24 19:08 fulalas

It should be running for applications to get configuration notifications, and for certain settings to be applied from configurations.

mmstick avatar Aug 12 '24 19:08 mmstick

So how can we find out what's happening? I'm suspecting this is due to some missing dependency, but I see no error, no warning, nothing.

fulalas avatar Aug 12 '24 19:08 fulalas

I basically have the same problem: While I'm already connected to a network when logging in via gdm, the network connection stays, but cosmic-applet-network won't show an icon but a blank space and when selected just shows "Airplane mode" (slider), "Wi-Fi" (slider) and "Visible Wireless Networks". However neither can I move the sliders nor do any networks show up.

The weird thing is I have 3 users on my machine, the user created during install runs the applet fine. The other two users experience the problem, thought one of the users is member of the very same groups as the first user (sys, network, power, sudo, lp, wheel). Every NetworkManager applet under gnome and KDE works fine on all users.

In journald I get

Aug 25 12:53:34 framework systemd[3784]: Started Application launched by COSMIC.
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletStatusArea: Acquired bus name: org.kde.StatusNotifierWatcher
Aug 25 12:53:42 framework dbus-broker[979]: A security policy denied :1.322 to send method call /org/freedesktop/NetworkManager/Settings:org.freedesktop.NetworkManager.Settings.LoadConnections to org.freedesktop.NetworkManager.
Aug 25 12:53:42 framework dbus-broker[979]: A security policy denied :1.326 to send method call /org/freedesktop/NetworkManager/Settings:org.freedesktop.NetworkManager.Settings.LoadConnections to org.freedesktop.NetworkManager.
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletNetwork: thread 'tokio-runtime-worker' panicked at cosmic-applet-network/src/network_manager/mod.rs:365:44:
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletNetwork: called `Result::unwrap()` on an `Err` value: MethodError(OwnedErrorName("org.freedesktop.NetworkManager.Settings.PermissionDenied"), Some("uid 3134 has no permission to perform this operation"), Msg { type: Error, serial: 1674, sender: UniqueName(":1.4"), reply-serial: 91, body: Signature("s"), fds: [] })
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletNetwork: stack backtrace:
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletBluetooth: bluetooth request error: Bluetooth operation in progress: br-connection-busy
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletNetwork: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletNetwork: thread 'tokio-runtime-worker' panicked at cosmic-applet-network/src/network_manager/mod.rs:365:44:
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletNetwork: called `Result::unwrap()` on an `Err` value: MethodError(OwnedErrorName("org.freedesktop.NetworkManager.Settings.PermissionDenied"), Some("uid 3134 has no permission to perform this operation"), Msg { type: Error, serial: 1687, sender: UniqueName(":1.4"), reply-serial: 91, body: Signature("s"), fds: [] })
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletNetwork: stack backtrace:
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletNetwork: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletStatusArea: Bus name 'org.kde.StatusNotifierWatcher' already owned
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletBluetooth: bluetooth request error: Bluetooth operation in progress: br-connection-busy
Aug 25 12:53:42 framework cosmic-panel[8129]: com.system76.CosmicAppletBluetooth: bluetooth request error: Bluetooth operation in progress: br-connection-busy
Aug 25 12:53:47 framework bluetoothd[982]: profiles/audio/avdtp.c:avdtp_connect_cb() connect to 64:72:D8:D7:33:29: Host is down (112)
Aug 25 12:53:47 framework cosmic-panel[8129]: com.system76.CosmicAppletBluetooth: bluetooth request error: Bluetooth operation failed: br-connection-page-timeout

I run Manjaro with kernel version 6.10.5-1-MANJARO #1 SMP PREEMPT_DYNAMIC, same issue regardless of building from sources through AUR or installing via binary packages.

grissu avatar Aug 25 '24 11:08 grissu

@fulalas To answer your question. You need Network Manager installed. Have you verified that the NetworkManager.service is running? systemctl status NetworkManager.service I am on Arch Linux and I was having the same issue. I installed Network Manager, enabled the systemctl enable NetworkManager, and systemctl start NetworkManager After doing that the wifi applet worked and the visible networks were available to establish a connection.

0xDEAD-C0DE avatar Aug 27 '24 00:08 0xDEAD-C0DE

Yes, NetworkManager is running, but the applet doesn't work. What is funny is that the network tab in cosmis-settings works just fine:

screenshot-2024-09-27-17-16-34

Clearly, the applet is doing something different that is not compatible with my system.

fulalas avatar Sep 27 '24 15:09 fulalas

I'm having the exact same behavior on NixOS:

Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork: thread 'tokio-runtime-worker' panicked at cosmic-applet-network/src/network_manager/mod.rs:365:44:
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork: called `Result::unwrap()` on an `Err` value: MethodError(OwnedErrorName("org.freedesktop.NetworkManager.Settings.PermissionDenied"), Some("uid 1000 has no permission to perform this operation"), Msg { type: Error, serial: 1033, sender: UniqueName(":1.11"), reply-serial: 192, body: Signature("s"), fds: [] })
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork: stack backtrace:
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:    0: rust_begin_unwind
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:    1: core::panicking::panic_fmt
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:    2: core::result::unwrap_failed
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:    3: cosmic_applet_network::network_manager::NetworkManagerState::new::{{closure}}
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:    4: cosmic_applet_network::network_manager::start_listening::{{closure}}
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:    5: <futures_util::stream::stream::map::Map<St,F> as futures_core::stream::Stream>::poll_next
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:    6: <futures_util::stream::select::Select<St1,St2> as futures_core::stream::Stream>::poll_next
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:    7: <futures_util::stream::stream::map::Map<St,F> as futures_core::stream::Stream>::poll_next
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:    8: <futures_util::stream::stream::map::Map<St,F> as futures_core::stream::Stream>::poll_next
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:    9: <futures_util::stream::stream::map::Map<St,F> as futures_core::stream::Stream>::poll_next
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:   10: iced_futures::subscription::tracker::Tracker::update::{{closure}}
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:   11: tokio::runtime::task::raw::poll
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:   12: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork:   13: tokio::runtime::task::raw::poll
Oct 11 10:56:25 deckchair .cosmic-panel-wrapped[2694]: com.system76.CosmicAppletNetwork: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

And this doesn't seem to be a permissions issue with my local system, nmcli will let me do whatever I want:

$ nmcli general permissions
PERMISSION                                                        VALUE
org.freedesktop.NetworkManager.checkpoint-rollback                yes
org.freedesktop.NetworkManager.enable-disable-connectivity-check  yes
org.freedesktop.NetworkManager.enable-disable-network             yes
org.freedesktop.NetworkManager.enable-disable-statistics          yes
org.freedesktop.NetworkManager.enable-disable-wifi                yes
org.freedesktop.NetworkManager.enable-disable-wimax               yes
org.freedesktop.NetworkManager.enable-disable-wwan                yes
org.freedesktop.NetworkManager.network-control                    yes
org.freedesktop.NetworkManager.reload                             yes
org.freedesktop.NetworkManager.settings.modify.global-dns         yes
org.freedesktop.NetworkManager.settings.modify.hostname           yes
org.freedesktop.NetworkManager.settings.modify.own                yes
org.freedesktop.NetworkManager.settings.modify.system             yes
org.freedesktop.NetworkManager.sleep-wake                         yes
org.freedesktop.NetworkManager.wifi.scan                          yes
org.freedesktop.NetworkManager.wifi.share.open                    yes
org.freedesktop.NetworkManager.wifi.share.protected               yes

More info here: https://github.com/lilyinstarlight/nixos-cosmic/issues/271#issuecomment-2408010959

graysonhead avatar Oct 14 '24 19:10 graysonhead

Yep. I noticed the same issue also in SerpentOS.

fulalas avatar Oct 14 '24 19:10 fulalas

So I dug into this a little bit. When constructing NetworkManagerState, and running .get_settings() on known connections, its failing on 2 of about 40 connections (I added some error handling so it wouldn't crash when unwrapping the result of the get_settings method.)

Here is the output of some debug messages I added, if it helps.

I'm not sure how to resolve these IDs to which specific connections are causing problems. But it is succeeding in calling get_settings on the other 30 some connections.

I'll see if I can troubleshoot a little further next time I get a chance, but I fear I've reached the limit of my dbus knowledge.

graysonhead avatar Oct 14 '24 21:10 graysonhead

I just wanted to echo that I'm having the same issue. I don't see an icon, and the Airplane Mode and Wi-Fi toggles don't work on the applet. I can connect fine to wifi or ethernet, and the page in the settings works. I'm on Pop!_OS 22.04 on a Lemur Pro lemp10.

nathansgithub avatar Oct 15 '24 21:10 nathansgithub

I was able to track down the two connections that were causing issues, and they are just regular saved wifi connections. There doesn't appear to be anything special about them.

Also, I forgot to mention previously, that with some error handling added to the .get_settings() result, the applet seems to work as expected. I'm happy to draft a PR for that, but It seems like a half-measure seeing as get_settings is still failing in situations where it shouldn't be. So it seems like the real bug is probably here.

graysonhead avatar Oct 16 '24 14:10 graysonhead

The issue is still here on alpha 3

Thatoo avatar Nov 04 '24 09:11 Thatoo

I think I found out my issue. I deleted all past connection setting that were containing a WEP wifi password, reboot and now the network applet display and is working.

Thatoo avatar Nov 14 '24 12:11 Thatoo

Same here, my setup with networkmanager use iwd (instatt of wpa_supplicated) ...

@Thatoo on which level you delete all? (cosmic, networkmanager, iwd/wpa_supplicated, ...)

wrenix avatar Jan 30 '25 22:01 wrenix

All files in /etc/NetworkManager/system-connections/ that were containing a WEP wifi password

Thatoo avatar Jan 31 '25 08:01 Thatoo

this is still happening today. even if you don't have any WEP wifi password in the folder mentioned by Thatoo

choucavalier avatar Dec 05 '25 10:12 choucavalier

This issue no longer exists. COSMIC network applet works fine, with or without a previously saved wifi password.

Also, contrary to what has been said, network-manager-applet is no longer a dependency, not even for entering a new wifi password. Everything just works!

For those who are still experiencing issues, I recommend building from current master or opening a new issue.

fulalas avatar Dec 05 '25 13:12 fulalas