jellyfin / jellyfin-android

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

The Android app gets stuck at login after Jellyfin v10.9.0. #1382

Closed maru801 closed 5 months ago

maru801 commented 6 months ago

Describe the bug

Ever since v10.9.0, after a successful login into the app, I can't reopen the Jellyfin Android app on my local network. If I do, I'm greeted with this screen: pic1 The screen doesn't say it can't find the server, but that the connection can't be established. If I tap on the "Connect" button, it just spams my logs with "Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.190" request". I pasted a snippet of my server logs of when this happens in the log section here. The only way to fix this is to clear out the cache and data stored for the app, and this only works once. I have to keep clearing out the data if I close the app.

I'm running the Jellyfin server as a custom app on a Truenas Scale system. I port forwarded the 8096 port to 9001. Strangely enough, I'm able to enter and use the Android app if I disconnect from my local network and start my Tailscale VPN.

I've tried the community app of Jellyfin that Truenas offers to use Host Networking to see if this solved my issue. Enabling Host Networking does solve my issue of local network access, but it now breaks my Tailscale access for when I'm away from my local network. When this happens, I get greeted with a loading circle that takes a while to bring me to a server select screen. The only way to get the app to work again is to delete the server at this screen, close the app, and reopen it. For some reason, this issue doesn't generate any logs. And just in case, I also ran into the same issue on a Synology nas while running Jellyfin v10.9.1 from a Docker container.

Logs

[INF] [26] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for "max" has succeeded.
[INF] [26] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user "max": 1/0
[INF] [26] Emby.Server.Implementations.Session.SessionManager: Creating new access token for user <redacted>
[INF] [16] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.190" request
[WRN] [28] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.1.190" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake."
[INF] [28] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.190" closed
[INF] [23] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.190" request
[INF] [23] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.190" request
[INF] [26] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.1.190" request

Application version

2.6.1

Where did you install the app from?

Google Play

Device information

Samsung Galaxy Note 9

Android version

Android 10 (w/ Samsung's One UI v2.5)

Jellyfin server version

10.9.1

Which video player implementations does this bug apply to?

KimPig commented 6 months ago

same here. Can't reconnect via reverse proxy.

EHRETic commented 6 months ago

same here. Can't reconnect via reverse proxy.

Hi there,

Same for me, stuck on the JF logo and no way to get it past it ;-)

taitsmith commented 6 months ago

semi able to replicate- updated to 10.9.1, signed out of active sessions on pixel 6 pro and experienced the same issues with 2.6.1 and debug built from the latest master branch. signing out all devices on the server dashboard / clearing cache / data seems to have fixed the issue on both the debug and 2.6.1 release versions. accessing the server remotely through tailscale also works after clearing data.

tested on physical pixel 6 pro android 14 (play store release / current master) and emulator pixel 8 pro android 14 (current master). i have an old samsung somewhere i can test on, if i can find it.

KimPig commented 6 months ago

semi able to replicate- updated to 10.9.1, signed out of active sessions on pixel 6 pro and experienced the same issues with 2.6.1 and debug built from the latest master branch. signing out all devices on the server dashboard / clearing cache / data seems to have fixed the issue on both the debug and 2.6.1 release versions. accessing the server remotely through tailscale also works after clearing data.

tested on physical pixel 6 pro android 14 (play store release / current master) and emulator pixel 8 pro android 14 (current master). i have an old samsung somewhere i can test on, if i can find it.

That's strange. I've deleted all devices from the server dashboard after updating to 10.9.0 and reinstalled the app on my phone, but I'm still having the same problem.

PrimeO7 commented 6 months ago

I have the same Issue, but only on one of my devices.

Both run Android 8.1 Both run Jellyfin Android 2.6.1 Server Version 10.9.1

Behavior of the Problem Device:

taitsmith commented 6 months ago

I have the same Issue, but only on one of my devices.

Both run Android 8.1 Both run Jellyfin Android 2.6.1 Server Version 10.9.1

interesting. can you post a bit of the server logs from when you (attempt) to connect with both devices? i’m still unable to reliably reproduce this with the 2.6.1 release, but building from the current master branch doesn’t seem to have any issues.

i do have a separate / potentially related issue on both android and ios but need to look into it more.

maru801 commented 6 months ago

I think being able to reliably reproduce this issue depends on what and how the Jellyfin server is installed.

I have a Truenas Scale NAS & a Synology NAS.

Using the Jellyfin server on my Truenas Scale system, I get this Android error while on my local network. Using a VPN to use an external network makes everything work fine on it however. If I enable host mode network, local network works and the Android app doesn't run into this issue, but then fails to connect at times while on the VPN.

On the Synology with Jellyfin running in a Docker container, local network also works fine but my VPN stops working.

I have both servers using pretty much the same settings to run Jellyfin, so I don't know why it behaves differently on both.

PrimeO7 commented 6 months ago

Okay, I no longer think the issue is caused by the android app. I was actually able to cause this on the Linux jellyfin media player 1.10.0 and 1.9.1 as well. I tried testing with android apk 2.6.0 and 2.6.1 the issue would persist with both.

I've decided to rollback my server to 10.8.13(docker linuxserver/jellyfin) and load the config files from a backup. Ofc, no more issue now.

I guess server version 10.9.0+ has introduced some bugs in Networking.

taitsmith commented 6 months ago

I guess server version 10.9.0+ has introduced some bugs in Networking.

i was leaning towards this as well since i’ve had issues with android and ios (but not android tv or web). the most common issue on 2.6.1 on android results from the webview throwing a 404 and displaying an empty screen, but i havent found anything specific to the servers not showing up.

DisloyalSnow911 commented 6 months ago

I have the same problem, just like the author.

maru801 commented 6 months ago

I would also like to point out that if I wait a few hours at random, the app usually enters my server just fine again, then breaks if I close it afterwards.

rusticrooster commented 6 months ago

I have the same problem. This is happening on my LAN and WAN for two android phones, but not my Android TV. My devices are both Android Galaxy S23. Accessing Jellyfin via web browser on the devices works fine. For the server configuration I am not using a reverse proxy or HTTPS. I am using Tailscale VPN. Let me know if you'd like more details.

svenlindekugel commented 6 months ago

this could be related to:

https://github.com/jellyfin/jellyfin/issues/11598 => Fix stored credentials not updating on logout jellyfin/jellyfin-web#5500

unfortunatly this fix is not included in yesterday released 10.9.2

maru801 commented 6 months ago

this could be related to:

https://github.com/jellyfin/jellyfin/issues/11598 => Fix stored credentials not updating on logout jellyfin/jellyfin-web#5500

unfortunatly this fix is not included in yesterday released 10.9.2

I'm confused. Isn't this fix mentioned as being included in the release notes on the jellyfin-web v10.9.2 release?

From the release notes on that page:

  • Fix stored credentials not updating on logout [PR #5500], by @thornbill
thornbill commented 6 months ago

Yes that PR was included in 10.9.2.

taitsmith commented 6 months ago

Yes that PR was included in 10.9.2.

seems to have resolved all relevant issues as i'm now unable to reproduce these on android or ios.

rusticrooster commented 6 months ago

I can confirm the issue persists for my Galaxy S23 devices following the 10.9.2 update.

rusticrooster commented 6 months ago

Tested this out on an iPad 6th generation OS version 17.4.1 - no issues.

taitsmith commented 6 months ago

@rusticrooster have you tried clearing storage / cache on your devices and starting fresh in that way? if you could post a bit of the server logs also that'd help narrow things down.

is your issue connecting to the server like the original screenshot? or are you able to log in successfully and then have errors on subsequent logins.

maru801 commented 6 months ago

One thing I noticed is that if you log into multiple accounts on the Android app, the server's Devices section in the admin dashboard does not create a new instance/device per user logged in.

The way it worked before, each new user that logged into the same device counted as a new separate device in the dashboard. I wonder if this has something to do with this issue.

The Jellyfin Media Player program was updated today, and logging into multiple accounts on that does produce multiple devices on the server. So far, my browser and the Android app just replace the name of the last logged-in user over the single device.

rusticrooster commented 6 months ago

Sure thing, taitsmith. The issue is produced by:

  1. clear all app data or fresh install Jellyfin.
  2. open Jellyfin and access the server, logging in is optional to reproduce as simply accessing the server is enough to trigger it.
  3. move away from the Jellyfin app in some way, minimize it or switch apps or go to the home screen.
  4. return to the Jellyfin app and you will see an error just like the image in the original post, you will not be able to access the server again until you delete all app data or reinstall the Jellyfin app.
rusticrooster commented 6 months ago

Device 192.168.50.43 is the Android phone with the issue. My router identifies 192.168.50.137 as "android-dhcp-9", it seems to relate to the Android phone but I'm not exactly sure what it is. Device 192.168.50.241 doesn't have an issue. I had hit the connect button several times to generate these logs.


> [2024-05-18 11:36:38.228 -06:00] [INF] [26] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" request
> [2024-05-18 11:37:22.891 -06:00] [INF] [61] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
> [2024-05-18 11:38:39.943 -06:00] [WRN] [61] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.50.137" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake."
> [2024-05-18 11:38:39.967 -06:00] [INF] [61] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" closed
> [2024-05-18 11:38:53.148 -06:00] [INF] [17] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" request
> [2024-05-18 11:40:46.891 -06:00] [INF] [17] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
> [2024-05-18 11:43:34.887 -06:00] [INF] [61] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
> [2024-05-18 11:44:19.064 -06:00] [INF] [14] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" request
> [2024-05-18 11:44:46.891 -06:00] [INF] [58] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
> [2024-05-18 11:44:46.893 -06:00] [WRN] [58] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.50.137" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake."
> [2024-05-18 11:44:46.893 -06:00] [INF] [58] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" closed
> [2024-05-18 11:46:22.891 -06:00] [INF] [23] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
> [2024-05-18 11:49:10.891 -06:00] [INF] [10] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
> [2024-05-18 11:49:22.891 -06:00] [INF] [58] Emby.Server.Implementations.Session.SessionWebSocketListener: Lost 1 WebSockets.
> [2024-05-18 11:49:46.891 -06:00] [INF] [10] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
> [2024-05-18 11:49:56.516 -06:00] [INF] [34] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" request
> [2024-05-18 11:50:05.640 -06:00] [WRN] [10] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.50.137" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake."
> [2024-05-18 11:50:05.640 -06:00] [INF] [10] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" closed
> [2024-05-18 11:51:58.247 -06:00] [WRN] [14] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.50.137" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake."
> [2024-05-18 11:51:58.282 -06:00] [INF] [14] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" closed
> [2024-05-18 11:52:11.563 -06:00] [INF] [58] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" request
> [2024-05-18 11:52:16.331 -06:00] [INF] [63] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:52:16.352 -06:00] [INF] [63] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:52:17.306 -06:00] [INF] [64] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:52:58.791 -06:00] [INF] [52] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.241" closed
> [2024-05-18 11:52:58.994 -06:00] [INF] [41] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.241" request
> [2024-05-18 11:53:34.891 -06:00] [INF] [64] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 3 inactive WebSockets.
> [2024-05-18 11:54:22.892 -06:00] [INF] [63] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 3 inactive WebSockets.
> [2024-05-18 11:54:47.999 -06:00] [WRN] [41] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.50.43" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake."
> [2024-05-18 11:54:47.999 -06:00] [WRN] [58] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.50.43" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake."
> [2024-05-18 11:54:47.999 -06:00] [WRN] [39] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.50.43" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake."
> [2024-05-18 11:54:48.031 -06:00] [INF] [58] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:54:48.063 -06:00] [INF] [39] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:54:48.177 -06:00] [INF] [41] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:55:23.814 -06:00] [INF] [23] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:55:24.120 -06:00] [INF] [63] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:55:24.813 -06:00] [INF] [61] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:55:24.837 -06:00] [INF] [63] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:55:25.646 -06:00] [INF] [8] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:55:25.667 -06:00] [INF] [39] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:55:25.806 -06:00] [INF] [63] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:55:26.817 -06:00] [INF] [61] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:55:26.854 -06:00] [INF] [23] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:55:27.130 -06:00] [INF] [8] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:55:27.135 -06:00] [INF] [41] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:55:27.170 -06:00] [INF] [8] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:55:27.806 -06:00] [INF] [23] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:55:27.833 -06:00] [INF] [23] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:55:28.679 -06:00] [INF] [63] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:55:28.692 -06:00] [INF] [63] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" closed
> [2024-05-18 11:55:29.834 -06:00] [INF] [63] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.43" request
> [2024-05-18 11:55:31.680 -06:00] [INF] [39] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" request
> [2024-05-18 11:55:34.891 -06:00] [INF] [39] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
> [2024-05-18 11:55:34.892 -06:00] [WRN] [39] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS "192.168.50.137" error receiving data: "The remote party closed the WebSocket connection without completing the close handshake."
> [2024-05-18 11:55:34.892 -06:00] [INF] [39] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "192.168.50.137" closed
> [2024-05-18 11:55:46.891 -06:00] [INF] [39] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
> [2024-05-18 11:56:46.891 -06:00] [INF] [61] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.```
Crispychickenlegs commented 6 months ago

I have the same Issue, but only on one of my devices.

Both run Android 8.1 Both run Jellyfin Android 2.6.1 Server Version 10.9.1

Behavior of the Problem Device:

  • Fresh reinstall
  • First time connecting to server via local ip: 192.168.1.14:8096
  • Login successful
  • Close app
  • Reopen app
  • Connection to server can't be established.
  • Close app and delete all app data
  • Add Server ip
  • Connecting to server works again until app is closed, than the cycle repeats.

I have exactly this issue also. I can use local IP and external address to access the server exactly once. After that all app data must be deleted for them to work again. This issue only occurs on my phone (Pixel 7), all other devices such as Chromecast or web browser have no issues.

Jellyfin Server 10.9.2 docker compose. Jellyfin Android 2.6.1 on Google Pixel 7.

Logs from server after a single reconnection attempt:

[07:38:22] [INF] [33] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:22] [INF] [33] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [19] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [19] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [19] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[07:38:23] [INF] [33] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [ERR] [33] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request: Invalid token. URL GET /socket.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [19] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[07:38:23] [INF] [19] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [19] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[07:38:23] [INF] [19] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [19] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [19] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:23] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[07:38:29] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:29] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:29] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[07:38:29] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:29] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[07:38:29] [INF] [20] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
omelettedufromagee commented 6 months ago

Just adding myself to this issue:

I have a Pixel 4a I cleared all sessions in Jellyfin Server. I'm able to use Findroid without a problem. image

scampower3 commented 6 months ago

I might have a potential fix here. Running Jellyfin on Docker on bridge mode here.

I had the same problem where I can only login once before it fails to connect on LAN. However, I can access the Jellyfin server just fine when I am outside through my nginx reverse proxy.

The main diff i observed in the logs where that when I was outside, Jellyfin routes it through the docker's 172.17. 0.0/16 ip address, but when I am in LAN, it tries to route through 127.0.0.1 instead.

Setting the Bind to local network address to the server's LAN ip ( in this case the docker's 172.17. 0.0/16 ip address) fixes that issue for me. This forces it to use the 172.17. 0.0/16 ip address always.

maru801 commented 6 months ago

Setting the Bind to local network address to the server's LAN ip ( in this case the docker's 172.17. 0.0/16 ip address) fixes that issue for me.

I get a similar result with enabling host network mode. My phone will work on LAN, but now will not work right when I switch to remote with a Tailscale VPN. Not using host mode results in the opposite.

scampower3 commented 5 months ago

Setting the Bind to local network address to the server's LAN ip ( in this case the docker's 172.17. 0.0/16 ip address) fixes that issue for me.

I get a similar result with enabling host network mode. My phone will work on LAN, but now will not work right when I switch to remote with a Tailscale VPN. Not using host mode results in the opposite.

Try setting ur docker to be in bridge mode and in Dashboard > Networking, input the Bind to local network address field to be ur docker internal ip (should be in the 172.17. 0.0/16 range)

maru801 commented 5 months ago

Tried that. Didn't help me or I'm doing something wrong. Thanks for the tip though.

To clarify though, when I switch to host network mode, remote connections don't break like the way described when I started this issue. It's more of a "soft-break". What I mean is that if I switch from local to remote with the VPN, it will log-in once on the VPN just fine. Then closing the app and opening it again results in a blue circle spinning for a good minute. After some time, the app will take me to a screen to select a server with my server on the screen. Trying to access my server through that will not work, I have to delete it and re-input my server IP to get access back. So it's not like the issue here where local network just straight up refuses to even do anything.

Also, I got a question about the bind network option. Looking at the logs, I keep seeing this: "Jellyfin.Networking.Manager.NetworkManager: Bind Addresses ["0.0.0.0"]"

Isn't the bind address supposed to change to whatever address I inserted in the "Bind to local network address" field in the network settings?

daniskarma commented 5 months ago

I can confirm this is still an issue with jellyfin server 10.9.2. installed in a docker container and android jellyfin 2.6.1. It started happening just as I updated the jellyfin server to over 10.9.0. Clearing data and cache does work until the app closes, once it need reconnect the connection to the server fails as described by author.

It doesn't seem to happen with other jellyfin client I've have installed, Gelly.

taitsmith commented 5 months ago

seems like a lot of the remaining issues are related to servers running in docker- if anyone still having trouble and receiving notifications here can confirm or deny this that'd be helpful.

rusticrooster commented 5 months ago

I am running on (Dragonfish) TrueNAS Scale, using the Jellyfin app made available by Truecharts. I believe the app uses Docker.

maru801 commented 5 months ago

I am running on (Dragonfish) TrueNAS Scale, using the Jellyfin app made available by Truecharts. I believe the app uses Docker.

Yeah it does in a way. Truenas Scale uses a wrapper to run Docker images within Kubernetes (k3s in this case).

I'm also running my Jellyfin server on Truenas Scale (v24.04.0 - Dragonfish). The only difference is that I'm running the official Jellyfin image as a custom app and not using the community or Truecharts provided Jellyfin apps. I pulled the image from Jellyfin's github.

If it helps, I'm also running Jellyfin on a Synology NAS using Docker using the same image. The only difference is the opposite happens (local network works, switching to remote breaks things).

Crispychickenlegs commented 5 months ago

Confirming that Jellyfin Server is running in docker. I've just tried again and it is still happening from android app, but only when attempting to connect remotely through Tailscale.

Here are some more logs:

Initial login via remote connection:

[11:19:45] [INF] [38] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for admin has succeeded.
[11:19:45] [INF] [38] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user admin: 0/0
[11:19:45] [INF] [38] Emby.Server.Implementations.Session.SessionManager: Creating new access token for user 4e944a8b-e80c-4b94-bbc9-44b8eb823205

After this, closed app without signing out. Attempt to reconnect using same URL after this results in 'connection cannot be established' and the following entries into the server log:

[11:19:45] [INF] [44] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 request
[11:20:11] [INF] [47] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 request
[11:20:19] [INF] [45] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 request
[11:20:24] [INF] [45] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 request
[11:20:30] [INF] [46] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 request
[11:20:56] [INF] [46] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 request
[11:20:57] [WRN] [46] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS 100.74.95.46 error receiving data: The remote party closed the WebSocket connection without completing the close handshake.
[11:20:57] [WRN] [50] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS 100.74.95.46 error receiving data: The remote party closed the WebSocket connection without completing the close handshake.
[11:20:57] [INF] [46] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 closed
[11:20:57] [INF] [50] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 closed
[11:20:57] [WRN] [52] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS 100.74.95.46 error receiving data: The remote party closed the WebSocket connection without completing the close handshake.
[11:20:57] [INF] [52] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 closed
[11:20:57] [WRN] [52] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS 100.74.95.46 error receiving data: The remote party closed the WebSocket connection without completing the close handshake.
[11:20:57] [INF] [52] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 closed
[11:20:57] [WRN] [46] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS 100.74.95.46 error receiving data: The remote party closed the WebSocket connection without completing the close handshake.
[11:20:57] [INF] [46] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 closed
[11:21:09] [INF] [52] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 closed
[11:21:10] [INF] [45] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 request
[11:22:35] [INF] [50] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
[11:22:47] [INF] [50] Emby.Server.Implementations.Session.SessionWebSocketListener: Lost 1 WebSockets.
[11:24:10] [WRN] [48] Emby.Server.Implementations.HttpServer.WebSocketConnection: WS 100.74.95.46 error receiving data: The remote party closed the WebSocket connection without completing the close handshake.
[11:24:10] [INF] [48] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 closed

Any further attempts results in:

[11:29:54] [INF] [32] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 request

If I log in through remote connection, then sign out, then close and reopen the app, the server is inaccessible, and the logs are as follows:

[11:48:24] [INF] [71] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for admin has succeeded.
[11:48:24] [INF] [71] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user admin: 0/0
[11:48:24] [INF] [71] Emby.Server.Implementations.Session.SessionManager: Logging out access token 9f3a279b29b1400b928be57329adf3a1
[11:48:24] [INF] [71] Emby.Server.Implementations.Session.SessionManager: Creating new access token for user 4e944a8b-e80c-4b94-bbc9-44b8eb823205
[11:48:24] [INF] [71] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 request
[11:49:28] [INF] [69] Emby.Server.Implementations.Session.SessionManager: Logging out access token 25df5017dea148028da018150cd66764
[11:49:28] [INF] [68] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.74.95.46 closed
[11:49:46] [INF] [70] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:46] [INF] [70] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:46] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:46] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:46] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:46] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:46] [ERR] [75] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request: Invalid token. URL GET /socket.
[11:49:46] [INF] [70] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:46] [INF] [70] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:46] [INF] [70] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:47] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:47] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [ERR] [73] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request: Invalid token. URL GET /socket.
[11:49:47] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:47] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:47] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:47] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:47] [ERR] [75] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request: Invalid token. URL GET /socket.
[11:49:48] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:48] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:48] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:48] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:48] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:48] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:48] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:48] [INF] [75] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:48] [INF] [74] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:48] [ERR] [74] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request: Invalid token. URL GET /socket.
[11:49:54] [INF] [74] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:54] [INF] [74] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:54] [INF] [74] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:54] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:54] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:54] [INF] [73] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:55] [INF] [74] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:55] [INF] [74] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:55] [INF] [74] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
[11:49:55] [INF] [74] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:55] [INF] [74] Jellyfin.Api.Auth.CustomAuthenticationHandler: CustomAuthentication was not authenticated. Failure message: Invalid token.
[11:49:55] [INF] [74] Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: CustomAuthentication was challenged.
KimPig commented 5 months ago

I'm running Jellyfin server on Windows, and I've built a reverse proxy with NPM, but I still can't resolve this error. It works without problem on the web or third-party apps such as Findroid.

voronind-com commented 5 months ago

Issue still persists for me on 10.9.2. I also assembled the debug apk from master just now with no luck. I use docker in bridge mode with Nginx as a reverse proxy with this config:

server
{
  server_name jelly.mydomain.com;
  listen 443 ssl;
  set $watch 10.1.0.11:8096;
  location /
  {
    allow 192.168.1.0/24;
    allow 10.1.0.1;
    deny all;

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;

    proxy_pass http://$watch$request_uri;

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
  }
  ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
  include /etc/letsencrypt/conf/options-ssl-nginx.conf;
  ssl_dhparam /etc/letsencrypt/conf/ssl-dhparams.pem;
}

And those global settings:

client_max_body_size 512g;
#error_log /var/log/nginx/errorr.log debug;
proxy_hide_header Content-Security-Policy;
proxy_hide_header X-Frame-Options;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_hide_header X-Content-Type-Options;

Link for the main project issue: https://github.com/jellyfin/jellyfin/issues/11658

QingFei7931 commented 5 months ago

There is an abnormal situation that makes it impossible to log in Log in and play for about 3 minutes before jumping back to the login screen. And it prompts that the connection cannot be established.

Application version 2.6.1

Where did you install the app from? Google Play

Device information Samsung Galaxy A53 5G

Android version Android 14 (One UI v6.0)

Jellyfin server version 10.9.2

Which video player implementations does this bug apply to? Web player (default)

The same device is installed Jellyfin for Android TV 0.16.10 There is no problem at all if you put it in

The above Traditional Chinese content comes from GOOGLE Translate Excuse my English skills...

ismay commented 5 months ago

Same here, when trying to log in, server just logs:

[09:16:48] [INF] [33] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 192.168.1.20 closed

This is with:

Logging into the Jellyfin instance via a browser works fine, but logging in with the Android app works once. After that the app shows a: "Connection cannot be established" error, and refuses to connect to the server.

It seems like this is happening since 10.9.2. I don't think it happened with 10.9.1

nielsvanvelzen commented 5 months ago

Closing this issue as it has been fixed in 10.9.3 via jellyfin/jellyfin-web#5566.

ismay commented 5 months ago

@nielsvanvelzen Thanks for the update. Just so I understand, what will users need to update to address this? The server, the android client, or both?

nielsvanvelzen commented 5 months ago

Just the server once the release is published, which includes the web interface that caused the issue.

voronind-com commented 5 months ago

When 10.9.3 release can be expected? It's tough to use J without mobile client.

ismay commented 5 months ago

When 10.9.3 release can be expected? It's tough to use J without mobile client.

Yeah. I know it's tough to give estimates, and it will be done when it's done. But android clients are currently not able to access my lib at all. Prioritizing a release that includes the patch that fixes this would be nice.

wolonggl commented 5 months ago

Version 10.9.3 still has the same issue.

maru801 commented 5 months ago

It fixed the issue on my end. Seems weird that it didn't for you.

voronind-com commented 5 months ago

Same, fixed on my end after the update 10.9.3.

ismay commented 5 months ago

Same, fixed on my end after the update 10.9.3.

Yup, for me too.

maru801 commented 5 months ago

Version 10.9.3 still has the same issue.

I found out that deleting your devices in the dashboard will break the app (and all other clients) from loading properly. Are you still stuck on the connection page as shown on the image I shared when I created this issue? Or do you at least get past that?

Maybe try clearing out your app data one more time if it's the latter.

ierc commented 5 months ago

Sure thing, taitsmith. The issue is produced by:

1. clear all app data or fresh install Jellyfin.

2. open Jellyfin and access the server, logging in is optional to reproduce as simply accessing the server is enough to trigger it.

3. move away from the Jellyfin app in some way, minimize it or switch apps or go to the home screen.

4. return to the Jellyfin app and you will see an error just like the image in the original post, you will not be able to access the server again until you delete all app data or reinstall the Jellyfin app.

I'm running into this exact issue. Seems to be happening no matter what Android version I have installed on my phone. Tried the past few from apkmirror and nothing works. I even tried versioning back my server with docker with no success.

Anexgohan commented 1 month ago

adding my 2cent too, having the exact issues described here, android app can connect over mobile network but not on the same wifi that my server is connected through via lan.