jellyfin / jellyfin-media-player

Jellyfin Desktop Client
GNU General Public License v2.0
2.88k stars 297 forks source link

JMP trying to acess server at localhost instead of actual domain #653

Open SvbZ3r0 opened 1 month ago

SvbZ3r0 commented 1 month ago

I have Jellyfin server behind an nginx reverse proxy at https://customdomain.com/base_url. I have been using this setup since Jellyfin's inception and haven't had any issues. I also haven't changed my configurations recently. Since updating to 1.10.1 (I'm not sure if the issue existed in 1.10.0 since I only had that installed for a single day), whenever I open the client, it takes me to the select server screen instead of auto logging in. When I try to login from there, it tells me "We're unable to connect to the selected server right now. Please ensure it is running and try again.". I'm sure this isn't a server issue since my server doesn't have any access logs relevant to this. From the logs, it looks like the media player is trying to reach https://127.0.0.1/base_url instead of https://customdomain.com/base_url. Relevant part of logs is below:

2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: begin onAppReady
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: onAppReady: loading dependencies
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: returning instance from getOrAddApiClient
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: Begin connect
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: Begin getAvailableServers
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: TypeError: Request scheme 'file' is unsupported
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: Begin connectToServers, with 1 servers
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: begin connectToServer
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: tryReconnect: http://127.0.0.1:8096/base_url
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: getTryConnectPromise http://127.0.0.1:8096/base_url
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: ConnectionManager requesting url: http://127.0.0.1:8096/base_url/system/info/public
2024-05-20 07:22:44.630 [info] unknown @ 0 - JS: fetchWithTimeout: timeoutMs: 20000, url: http://127.0.0.1:8096/lorien/system/info/public

The server credentials has a LocalAddress key that is being used:

2024-05-20 07:22:44.524 [info] unknown @ 0 - JS: Stored JSON credentials: {"Servers":[{"ManualAddress":"https://customdomain.com/base_url","LastConnectionMode":0,"Name":"base_url","Id":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","LocalAddress":"http://127.0.0.1:8096/base_url","DateLastAccessed":1716131852396,"AccessToken":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","UserId":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}]}

If I delete the server and add it again, I can log in without issues until some (I'm not sure how much exactly) time, when the issue repeats itself. Successful login after deleting and adding the server:

2024-05-20 07:38:15.358 [info] unknown @ 0 - JS: begin connectToServer
2024-05-20 07:38:15.358 [info] unknown @ 0 - JS: tryReconnect: https://customdomain.com/base_url
2024-05-20 07:38:15.463 [info] unknown @ 0 - JS: getTryConnectPromise https://customdomain.com/base_url
2024-05-20 07:38:15.463 [info] unknown @ 0 - JS: ConnectionManager requesting url: https://customdomain.com/base_url/system/info/public
2024-05-20 07:38:15.464 [info] unknown @ 0 - JS: fetchWithTimeout: timeoutMs: 20000, url: https://customdomain.com/base_url/system/info/public
2024-05-20 07:38:15.575 [info] unknown @ 0 - JS: fetchWithTimeout: succeeded connecting to url: https://customdomain.com/base_url/system/info/public
2024-05-20 07:38:15.575 [info] unknown @ 0 - JS: ConnectionManager response status: 200, url: https://customdomain.com/base_url/system/info/public
2024-05-20 07:38:15.576 [info] unknown @ 0 - JS: Reconnect succeeded to https://customdomain.com/base_url
2024-05-20 07:38:15.576 [info] unknown @ 0 - JS: returning instance from getOrAddApiClient
2024-05-20 07:38:15.576 [info] unknown @ 0 - JS: Setting server address to https://customdomain.com/base_url

Desktop:

Additional context Problem did not exist before v1.10

Full log file: JellyfinMediaPlayer.log