https://bugs.kde.org/show_bug.cgi?id=524179

            Bug ID: 524179
           Summary: Invisible on network after link flap: LAN provider not
                    rebound (variation of 477670)
    Classification: Applications
           Product: kdeconnect
      Version First 25.04.2
       Reported In:
          Platform: Debian stable
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: common
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Operating System: Debian GNU/Linux 13
KDE Plasma Version: 6.3.6
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.2
Kernel Version: 6.12.101+deb13-amd64 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7 CPU         860  @ 2.80GHz
Memory: 12 Gio of RAM (11.7 Gio usable)
Graphics Processor: NVIDIA GeForce GTX 1050 Ti


ADDITIONAL INFORMATION
Product: kdeconnect
Component: common

Repro:
1. Debian 13 (trixie, Plasma), kdeconnect 25.04.2-1+deb13u1.
2. Wired network interface (enp5s0), Avahi running.
3. Let the network interface drop/change state (network flap, micro-outage, or
   link renegotiation) while kdeconnectd keeps running.
4. Elixir (this host) disappears from all other KDE Connect devices and stops
   discovering them, until the user manually restarts the app / daemon or
   forces a refresh.

Observed journal (kdeconnectd log), pattern repeating at each flap:

    21:06:59 Error sending UDP packet: QAbstractSocket::NetworkError
    21:07:04 new capabilities for "Katukina"
    22:51:02 Error sending UDP packet: QAbstractSocket::NetworkError
    22:51:08 new capabilities for "Pixel 6a"
    08:50:35 Error sending UDP packet: QAbstractSocket::NetworkError
    08:51:51 TCP server not listening, not broadcasting
    09:17:43 Error sending UDP packet: QAbstractSocket::NetworkError
    09:17:49 new capabilities for "Pixel 6a"
    09:28:51 new capabilities for "dump 13"

After a network change, kdeconnectd stops broadcasting and listening: the
UDP/TCP :1716 sockets become invalid and are never recreated. The daemon keeps
running (no crash) but the host becomes invisible until a manual restart /
refresh recreates the sockets.

Root cause (code): in LanLinkProvider::debouncedOnNetworkChange()
(core/backends/lan/lanlinkprovider.cpp), when the TCP server is no longer
listening, it logs "TCP server not listening, not broadcasting" and RETURNS
without restarting / rebinding the server or the UDP socket. So when the
network flaps, the LAN provider is never brought back up.

Notes:
- This is NOT a sleep/hibernate scenario (bug 477670 uses sleep; here only the
  network link toggles). In our environment the network flaps are caused by
  occasional micro-outages on a wired link.
- Unlike bug 499604, mDNS/Avahi keeps working; the failure is limited to the
  UDP broadcast/TCP listener of the LAN provider.
- The daemon is started once at login and runs for days (confirmed: PID
  2587 started 10 Aug, still up when the errors occur on 11-12 Aug).
- Workaround used on Elixir: a systemd user service with Restart=always plus a
  NetworkManager dispatcher script that restarts kdeconnectd on every
  interface "up" event. This confirms the socket is the problem: restarting
  the process fixes visibility immediately (sockets rebound within seconds,
  devices reappear without manual refresh).

Expected: on network reachability/medium change, LanLinkProvider should
rebind the UDP socket and re-listen on TCP when the server has dropped,
instead of returning early from debouncedOnNetworkChange().

Environment:
- Distro: Debian GNU/Linux 13.6 (trixie)
- kdeconnect / kdeconnect-libs: 25.04.2-1+deb13u1
- Network: Ethernet (enp5s0) 192.168.1.25/24, fixed wired link
- avahi-daemon: active

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to