jellyfin / jellyfin-web

Web Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.31k stars 1.23k forks source link

Playback at ha-proxy not possible after 5 Minutes #5755

Closed PinPhreek closed 2 months ago

PinPhreek commented 2 months ago

Describe The Bug Hello everyone, I am hosting a private Jellyfin (10.9.7)-Instance on Docker. Since I want to host it for my family, but not publicly, I established a wireguard tunnel and put an haproxy (also in a docker container, together with wireguard) as a proxy to forward the connection. The problem is, after a short time, I'm only able to view the site, but not playing back anything, unless the HA-Proxy-Container is restarted. The same happens if you pause and continue after like 5 minutes.

I traced back the tcp-connection with wireshark and I got a 504 Gateway Timeout. A few minutes later I reproduced the error and found the following error in my Jellyfin log (see logs-section)

Steps To Reproduce

  1. Restart the HA-Proxy/wireguard-tunnel
  2. wait 5 minutes
  3. try to consume media
  4. Fail

Expected Behavior It should start playing my media.

Logs

jellyfin  | [18:53:36] [INF] [23] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for admin. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
jellyfin  | [18:54:51] [INF] [11] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.
jellyfin  | [18:55:03] [INF] [15] Emby.Server.Implementations.Session.SessionWebSocketListener: Lost 1 WebSockets.

Screenshots

System (please complete the following information):

Additional Context

My haproxy.cfg:

defaults
    maxconn 50000
    timeout connect 10s
    timeout client 30s
    timeout server 30s
    log global

frontend jellyfin_proxy
    bind *:8096
    mode http
# Note that haproxy requires you to concatenate the certificate and key into a single file
# Uncomment the appropriate lines after you have acquired a SSL Certificate
#
#  HAProxy <1.7
#    bind *:443 ssl crt /etc/ssl/DOMAIN_NAME.pem
#
#  HAProxy >1.8
#    bind *:443 ssl crt /etc/ssl/DOMAIN_NAME.pem alpn h2,http/1.1
#    redirect scheme https if !{ ssl_fc }
#
# Uncomment these lines to allow LetsEncrypt authentication
#    acl letsencrypt_auth path_beg /.well-known/acme-challenge/
#    use_backend letsencrypt if letsencrypt_auth

#    acl jellyfin_server hdr(host) -i DOMAIN_NAME
    default_backend jellyfin #if jellyfin_server
#    use_backend jellyfin if is_websocket

backend jellyfin
    mode http
    option http-server-close
    #timeout http-keep-alive 30s
    timeout tunnel 1h
    option httpchk
    option forwardfor
    http-check send meth GET uri /health
    http-check expect string Healthy
    server jellyfin 192.168.3.3:8096

# Uncomment these lines to allow LetsEncrypt authentication
#
#backend letsencrypt
#    server letsencrypt 127.0.0.1:8888
thornbill commented 2 months ago

I don't know ha-proxy, but this definitely seems like a configuration issue. Please try asking the community for help.