jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.72k stars 466 forks source link

Client constantly disconnecting/connecting #3961

Closed jjmirks closed 3 weeks ago

jjmirks commented 3 weeks ago

Describe the bug

AndroidTV clients connect then disconnect every 30 seconds when media is not streaming. This happens intermittently but it's generating thousands of logs that aren't useful. It only happens with AndroidTV clients; web, windows app, and android app clients don't do this.

I thought it might have been a load balancer or proxy issue so I also tried hosting a server directly on my desktop and the issue persisted.

This thread on the jellyfin forum seems to be the same issue: https://forum.jellyfin.org/t-solved-remote-user-constantly-online-disconnected

Logs

[2024-09-04 16:49:18.463 -04:00] [DBG] [3] Emby.Server.Implementations.Session.SessionWebSocketListener: Watching 1 WebSockets.
[2024-09-04 16:49:26.163 -04:00] [DBG] [19] Emby.Server.Implementations.Session.WebSocketController: Removing websocket from session "3ad4d490b1a84e779dd30e0ebe45bb4c"
[2024-09-04 16:49:26.165 -04:00] [DBG] [17] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-09-04 16:49:26.166 -04:00] [DBG] [19] Emby.Server.Implementations.Session.SessionManager: Disposing session controller asynchronously "WebSocketController"
[2024-09-04 16:49:26.166 -04:00] [INF] [17] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.23" request
[2024-09-04 16:49:26.167 -04:00] [DBG] [19] Emby.Server.Implementations.Session.SessionWebSocketListener: WebSocket "Emby.Server.Implementations.HttpServer.WebSocketConnection" is closed.
[2024-09-04 16:49:26.169 -04:00] [INF] [19] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.23" closed
[2024-09-04 16:49:26.172 -04:00] [DBG] [17] Emby.Server.Implementations.Session.SessionManager: Creating new "WebSocketController"
[2024-09-04 16:49:26.173 -04:00] [DBG] [17] Emby.Server.Implementations.Session.WebSocketController: Adding websocket to session "3ad4d490b1a84e779dd30e0ebe45bb4c"
[2024-09-04 16:49:26.176 -04:00] [DBG] [20] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.1.23" received message: InboundWebSocketMessage`1 { Data: null, MessageType: KeepAlive, ServerId: null }
[2024-09-04 16:49:38.177 -04:00] [DBG] [17] Emby.Server.Implementations.Session.SessionWebSocketListener: Watching 1 WebSockets.
[2024-09-04 16:49:44.901 -04:00] [DBG] [18] Emby.Server.Implementations.Session.WebSocketController: Removing websocket from session "3ad4d490b1a84e779dd30e0ebe45bb4c"
[2024-09-04 16:49:44.903 -04:00] [DBG] [3] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was successfully authenticated.
[2024-09-04 16:49:44.904 -04:00] [DBG] [18] Emby.Server.Implementations.Session.SessionManager: Disposing session controller asynchronously "WebSocketController"
[2024-09-04 16:49:44.904 -04:00] [INF] [3] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.23" request
[2024-09-04 16:49:44.904 -04:00] [DBG] [18] Emby.Server.Implementations.Session.SessionWebSocketListener: WebSocket "Emby.Server.Implementations.HttpServer.WebSocketConnection" is closed.
[2024-09-04 16:49:44.906 -04:00] [DBG] [3] Emby.Server.Implementations.Session.SessionManager: Creating new "WebSocketController"
[2024-09-04 16:49:44.906 -04:00] [INF] [18] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.23" closed
[2024-09-04 16:49:44.907 -04:00] [DBG] [3] Emby.Server.Implementations.Session.WebSocketController: Adding websocket to session "3ad4d490b1a84e779dd30e0ebe45bb4c"
[2024-09-04 16:49:44.910 -04:00] [DBG] [3] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.1.23" received message: InboundWebSocketMessage`1 { Data: null, MessageType: KeepAlive, ServerId: null }

Application version

0.17.4

Where did you install the app from?

Google Play

Device information

Nvidia Shield 2019

Android version

Android 11

Jellyfin server version

10.9.10

Alliyance commented 3 weeks ago

Same here.

nielsvanvelzen commented 3 weeks ago

The WebSocket connection attempts to reconnect when it is abruptly killed. This mostly happens with bad reverse proxy configurations. Use our forums/troubleshoot chat to get help with that.