Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network sometimes shows as disconnected when it's not #388

Closed
pedrocr opened this issue Jun 15, 2019 · 23 comments · Fixed by #1106
Closed

Network sometimes shows as disconnected when it's not #388

pedrocr opened this issue Jun 15, 2019 · 23 comments · Fixed by #1106
Labels
bug Something isn't working
Milestone

Comments

@pedrocr
Copy link
Contributor

pedrocr commented Jun 15, 2019

I often get the network shown as Disconnected when it's actually not. Restarting waybar fixes it. Let me know what kind of information you need to debug this.

@FreeFull
Copy link

It seems like #354 came back. I'm also experiencing this.

@nikto-b
Copy link
Contributor

nikto-b commented Jun 16, 2019

Same problem today came. Shows "disconnected" all time, excepting time wifi-menu is open in terminal
Arch Linux
Waybar v0.6.6-28-gfcf2d18 (May 30 2019, branch 'master')
UPD: reconnected to WIFI with netctl-auto, fixed problem
No data in output excepting messages Gdk-WARNING **: 15:04:30.647: Couldn't map as window 0x5577c9792650 as popup because it doesn't have a parent

@Alexays Alexays added the bug Something isn't working label Jun 16, 2019
@apognu
Copy link

apognu commented Jul 8, 2019

Experiencing the same issue, but on my end, it seems related to multihead and/or sleep. Whenever I come back from sleep, the status shows disconnected until I reload sway, and sometimes, one of the screen shows my SSID while the other shows up disconnected.

@pedrocr
Copy link
Contributor Author

pedrocr commented Jul 9, 2019

I see this happen a lot when I change Wifi networks. I think I can reproduce this mostly at will.

@MichaelAquilina
Copy link
Contributor

I came here to post an issue that #354 was back and found this issue. In my case, the network connection is just out of date. For example it would show wireless as active when I would have deactivated it.

@farid-fari
Copy link

Am also affected, though I cannot link directly to sleep

@pedrocr
Copy link
Contributor Author

pedrocr commented Aug 16, 2019

This is really annoying. I wondered today if it was something to do with changing between APs with the same SSID.

@GrantMoyer
Copy link
Contributor

GrantMoyer commented Oct 19, 2019

I've been able to reproduce this reliably.

System: Arch Linux, systemd-networkd, iwd

/etc/systemd/network/25-wireless.network:

[Match]
Name=wlan0

[Network]
DHCP=yes

Steps to reproduce:

  1. Connect to network A: iwctl station wlan0 connect A
  2. Connect to network B: iwctl station wlan0 connect B
  3. Restart waybar. At this point, the network B should be shown by the Network module.
  4. Connect back to network A: iwctl station wlan0 connect A. The network module will now show a disconnected state.

The problem can be temporarily resolved by either:

  • Restarting waybar
  • Restarting systemd-networkd: systemctl restart systemd-networkd.service

Running waybar with --log-level trace reveals nothing about the bug.

@Alexays Alexays added this to the 1.0.0 milestone Apr 6, 2020
@ghost
Copy link

ghost commented Apr 25, 2020

In my case uncommenting Interface wlp4s0line in config and letting the ip be static solves the problem.

Before that change, ip addr showed lot of ip6 addresses and 2 ip4 addresses. I changed to static ip and now I have just one ip4 and one ip6. The problem has gone.

I have 2 wireless nets in my house so If I go to the garden it connects to the second net.

@chron-isch
Copy link

I'm having the same problem with Arch, sway and current master, restarting waybar or disabling&enabling the output waybar is using also updates it.

@varac
Copy link

varac commented Jul 3, 2020

Same here with Waybar v0.9.2 (Apr 11 2020, branch 'master') on Ubuntu 20.04 with sway 1.4-f681d529 (Jan 22 2020, branch 'heads/1.4')

@GbGp
Copy link

GbGp commented Oct 17, 2020

I can reproduce this issue with iwd by simply switching to another AP or even by simply disconnecting and reconnecting to the same one.

I'm trying to monitor the events passed to Network::handleEvents, but it looks like I miss many events when I use a debugger compared to just printing nlmsg_type to stdout. I don't now much about libnl so I can't say if that's just some timeout or a race condition somewhere in the code. Also, I can't reproduce a single case where Network::checkNewInterface finds a valid interface.
From what I see I am quite confident that #511 is the same issue as this one.

For now I managed to work around the issue by skipping checkNewInterface and just kicking the timer GbGp@3271258, but I'm not sure what I'm breaking there.

@dR3b
Copy link

dR3b commented Oct 20, 2020

Same here with NetworkManager on Arch Linux (Waybar v0.9.4)

@shelmus
Copy link

shelmus commented Oct 22, 2020

Arch Linux kernel 5.9.1-arch1-1 / Waybar v0.9.4 / sway version v1.5
iwd / systemd-networkd

Looking at the logs, it lost carrier and reconnected.
Oct 22 10:29:01 systemd-networkd[239]: wlan0: Gained carrier
Oct 22 10:29:01 systemd-networkd[239]: wlan0: DHCPv4 address 10.0.1.87/23 via 10.0.0.1
Oct 22 10:29:49 systemd-networkd[239]: wlan0: Lost carrier
Oct 22 10:29:49 systemd-networkd[239]: wlan0: DHCP lease lost
Oct 22 10:29:49 systemd-networkd[239]: wlan0: DHCPv6 lease lost
Oct 22 10:29:50 systemd-networkd[239]: wlan0: Gained carrier
Oct 22 10:29:50 systemd-networkd[239]: wlan0: Lost carrier
Oct 22 10:29:50 systemd-networkd[239]: wlan0: DHCPv6 lease lost
Oct 22 10:29:51 systemd-networkd[239]: wlan0: Gained carrier
Oct 22 10:29:51 systemd-networkd[239]: wlan0: DHCPv4 address 10.0.1.87/23 via 10.0.0.1

journal -xe
Oct 22 10:29:50 kernel: iwlwifi 0000:02:00.0: No beacon heard and the time event is over already...
Oct 22 10:29:50 kernel: wlan0: Connection to AP cc:f4:11:4b:e0:a3 lost
Oct 22 10:29:50 iwd[332]: Received Deauthentication event, reason: 4, from_ap: false
Oct 22 10:29:50 systemd-networkd[239]: wlan0: Lost carrier
Oct 22 10:29:50 systemd-networkd[239]: wlan0: DHCPv6 lease lost
Oct 22 10:29:50 kernel: wlan0: authenticate with cc:f4:11:4b:e0:a3
Oct 22 10:29:50 kernel: wlan0: send auth to cc:f4:11:4b:e0:a3 (try 1/3)
Oct 22 10:29:51 kernel: wlan0: authenticated
Oct 22 10:29:51 kernel: wlan0: associate with cc:f4:11:4b:e0:a3 (try 1/3)
Oct 22 10:29:51 kernel: wlan0: RX AssocResp from cc:f4:11:4b:e0:a3 (capab=0x1011 status=0 aid=12)
Oct 22 10:29:51 kernel: wlan0: associated
Oct 22 10:29:51 systemd-networkd[239]: wlan0: Gained carrier
Oct 22 10:29:51 systemd-networkd[239]: wlan0: DHCPv4 address 10.0.1.87/23 via 10.0.0.1
Oct 22 10:29:51 kernel: wlan0: Limiting TX power to 30 (30 - 0) dBm as advertised by cc:f4:11:4b:e0:a3
Oct 22 10:30:21 systemd[1]: systemd-hostnamed.service: Succeeded.

Wondering if its more related to iwd or systemd / kernel, still weird the module isn't picking up the connect status.

@insidewhy
Copy link

insidewhy commented Dec 27, 2020

Same problem here with latest everything:

5.9.14-arch1-1
waybar 0.9.4-5
networkmanager 1.26.4-1

Restarting waybar shows my connection again, but after a few minutes it goes back to showing "disconnected" again. When the network drops and wpa_supplicant immediately reconnects, waybar loses track of the connection forever.

@petrmanek
Copy link

petrmanek commented Jan 4, 2021

Hi! Also experiencing this with the latest version:

  • linux 5.10.4.arch2-1
  • waybar 0.9.5-2
  • networkmanager 1.26.4-1

Same symptoms as described above. Please let me know if I can provide any more data useful for troubleshooting.

@savchenko
Copy link

Can confirm. Given how easy is to jam a script that outputs some basic network information (which can be pulled by waybar) and sheer number of bugs reported about the network module, I wonder if it is worth investing time in it?

Perhaps shipping some basic *.sh and focusing on the core functionality will provide a better ROI?

@pedrocr
Copy link
Contributor Author

pedrocr commented May 21, 2021

This is even worse for me after this merge. After a little while of waybar being running it just changes to "Disconnected".

@Alexays
Copy link
Owner

Alexays commented May 22, 2021

@tperard any ideas?

@tperard
Copy link
Contributor

tperard commented May 23, 2021

This is even worse for me after this merge. After a little while of Waybar being running it just changes to "Disconnected".

Hi @pedrocr, thanks for testing the changes!

Let's try to debug that.
Could you let me know of your configuration for the network module? (At least the value for "interface".)
Could you let me know the state of your network interface as reported by ip link, for both when Waybar shows it as connected and as "Disconnected".
Could you try to run Waybar with "--log-level debug"? (I'm interested in at least the log lines which have "network:" if you want to trim the log.)
It seems your network interface is WiFi, it probably doesn't matter but do you use iwd or wpa_supplicant for it?

If you only have answer to some of those question, but not all, it still going to be useful.

Cheers.

@minhduc0711
Copy link

@tperard I have the same issue, so just chiming in :)

  • Network module config
"network": {
    "interface": "wlp3s0",
	...
}
  • ip link outputs the same thing whether Waybar displays "connected" or "disconnected":
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp2s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 98:29:a6:48:90:5c brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether 98:22:ef:77:0a:cd brd ff:ff:ff:ff:ff:ff
  • Waybar log does not print anything when the bar changes to "disconnected". I only spot these lines when starting waybar:
[2021-05-24 09:25:40.911] [debug] network: selecting new interface wlp3s0/3
[2021-05-24 09:25:40.911] [debug] network: wlp3s0, new addr 192.168.100.6/24
  • I do use wpa_supplicant.

tperard added a commit to tperard/Waybar that referenced this issue May 27, 2021
Some RTM_NEWLINK messages may not have the IFLA_CARRIER information.
This is the case when a WiFi interface report scan result are
available. `carrier` is used regardless of if it is present in the
message or not. This would result in the interface appearing
"disconnected" in waybar when it isn't.

This patch now check that `carrier` is available before using it.

The same thing could potentially happen to `ifname` so check if it's
set before recording it.

Fixes: c1427ff (network: Handle carrier information)
Fixes Alexays#388
@Alexays
Copy link
Owner

Alexays commented May 27, 2021

@minhduc0711 can you test with latest @tperard changes? #1116

@minhduc0711
Copy link

It works well now, thanks for looking into it!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.