linuxserver / docker-jellyfin

GNU General Public License v3.0
642 stars 97 forks source link

[BUG] 502 gateway error from rev proxy when no port is exposed on container #195

Closed miguelarios closed 1 year ago

miguelarios commented 1 year ago

Is there an existing issue for this?

Current Behavior

I am getting a 502 error when in my rev proxy (NginxProxyManager) i only have container name and 8096 as port and I'm using a custom bridge network called "proxy-net"

---
version: "3"
services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    environment:
      - PUID=99
      - PGID=100
      - TZ=America/Chicago
      - UMASK=022
      #- JELLYFIN_PublishedServerUrl=192.168.0.5 #optional
    volumes:
      - /mnt/user/appdata/jellyfin:/config
      - /mnt/user/media:/data/media
    #ports:
      #- 8096:8096 # required webUI
      #- 8920:8920 #optional Https webUI (you need to set up your own certificate).
      #- 7359:7359/udp #optional Allows clients to discover Jellyfin on the local network.
      #- 1900:1900/udp #optional Service discovery used by DNLA and clients.
    networks:
      - proxy-net
    restart: always

networks:
  proxy-net:
    external: true

Expected Behavior

be able to access jellyfin webUI through rev proxy without exposing a container port to host since I have a custom bridge network.

Steps To Reproduce

  1. Create a custom bridge network
  2. Add rev proxy to custom bridge network
  3. Remove ports from jellyfin docker compose
  4. Add a proxy host with container name and port on your rev proxy
  5. See 502 error
  6. Go back and add a port to docker compose and recreate container
  7. Watch how 502 error goes away.

Environment

- OS: Unraid 6.11.5
- How docker service was installed: docker compose

CPU architecture

x86-64

Docker creation

---
version: "3"
services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    environment:
      - PUID=99
      - PGID=100
      - TZ=America/Chicago
      - UMASK=022
      #- JELLYFIN_PublishedServerUrl=192.168.0.5 #optional
    volumes:
      - /mnt/user/appdata/jellyfin:/config
      - /mnt/user/media:/data/media
    #ports:
      #- 8096:8096 # required webUI
      #- 8920:8920 #optional Https webUI (you need to set up your own certificate).
      #- 7359:7359/udp #optional Allows clients to discover Jellyfin on the local network.
      #- 1900:1900/udp #optional Service discovery used by DNLA and clients.
    networks:
      - proxy-net
    restart: always

networks:
  proxy-net:
    external: true

### Container logs

```bash
text  error  warn  system  array  login  

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support the app dev(s) visit:
Jellyfin: https://opencollective.com/jellyfin

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    99
User GID:    100
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[13:43:31] [INF] [1] Main: Jellyfin version: 10.8.9
[13:43:31] [INF] [1] Main: Environment Variables: ["[JELLYFIN_CONFIG_DIR, /config]", "[JELLYFIN_CACHE_DIR, /config/cache]", "[JELLYFIN_LOG_DIR, /config/log]", "[JELLYFIN_WEB_DIR, /usr/share/jellyfin/web]", "[JELLYFIN_DATA_DIR, /config/data]"]
[13:43:31] [INF] [1] Main: Arguments: ["/usr/lib/jellyfin/bin/jellyfin.dll", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]
[13:43:31] [INF] [1] Main: Operating system: Linux
[13:43:31] [INF] [1] Main: Architecture: X64
[13:43:31] [INF] [1] Main: 64-Bit Process: True
[13:43:31] [INF] [1] Main: User Interactive: True
[13:43:31] [INF] [1] Main: Processor count: 24
[13:43:31] [INF] [1] Main: Program data path: /config/data
[13:43:31] [INF] [1] Main: Web resources path: /usr/share/jellyfin/web
[13:43:31] [INF] [1] Main: Application directory: /usr/lib/jellyfin/bin/
[13:43:31] [INF] [1] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: /config/cache
[13:43:31] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies
[13:43:31] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly Jellyfin.Plugin.Bookshelf, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null from /config/data/plugins/Bookshelf/Jellyfin.Plugin.Bookshelf.dll
[13:43:31] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly InfuseSync, Version=1.4.2.0, Culture=neutral, PublicKeyToken=null from /config/data/plugins/InfuseSync_1.4.2.0/InfuseSync.dll
[13:43:31] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly Jellyfin.Plugin.YoutubeMetadata, Version=1.0.3.8, Culture=neutral, PublicKeyToken=null from /config/data/plugins/YoutubeMetadata_1.0.3.9/Jellyfin.Plugin.YoutubeMetadata.dll
[13:43:31] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly NYoutubeDLP, Version=0.12.1.0, Culture=neutral, PublicKeyToken=null from /config/data/plugins/YoutubeMetadata_1.0.3.9/NYoutubeDLP.dll
[13:43:31] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly System.IO.Abstractions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=96bf224d23c43e59 from /config/data/plugins/YoutubeMetadata_1.0.3.9/System.IO.Abstractions.dll
[13:43:31] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[13:43:31] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []
[13:43:31] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[13:43:31] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind addresses: []
[13:43:31] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind exclusions: []
[13:43:37] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Bookshelf 9.0.0.0
[13:43:37] [INF] [1] InfuseSync.Plugin: InfuseSync is starting.
[13:43:37] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: InfuseSync 1.4.2.0
[13:43:37] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: YoutubeMetadata 1.0.3.9
[13:43:37] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: TMDb 10.8.9.0
[13:43:37] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Studio Images 10.8.9.0
[13:43:37] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: OMDb 10.8.9.0
[13:43:37] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: MusicBrainz 10.8.9.0
[13:43:37] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AudioDB 10.8.9.0
[13:43:37] [INF] [1] Main: Kestrel listening on Any IP4 Address
[13:43:37] [WRN] [1] Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository: Using an in-memory repository. Keys will not be persisted to storage.
[13:43:37] [WRN] [1] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager: Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
[13:43:37] [WRN] [1] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager: No XML encryptor configured. Key {dd7ef41d-5c0a-44e7-b36a-877b1945a836} may be persisted to storage in unencrypted form.
[13:43:37] [INF] [1] Emby.Server.Implementations.ApplicationHost: Running startup tasks
[13:43:37] [INF] [1] InfuseSync.ScheduledTasks.HousekeepingTask: Infuse housekeeping task scheduled.
[13:43:37] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for Remove Old Cached Data set to fire at 2023-04-04 00:01:00.000 -05:00, which is 10:17:22.4517232 from now.
[13:43:37] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for Extract Chapter Images set to fire at 2023-04-04 02:00:00.000 -05:00, which is 12:16:22.4367107 from now.
[13:43:37] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Found ffmpeg version 5.1.2
[13:43:37] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available decoders: ["libdav1d", "av1", "av1_cuvid", "av1_qsv", "h264", "h264_qsv", "h264_cuvid", "hevc", "hevc_qsv", "hevc_cuvid", "mpeg2video", "mpeg2_qsv", "mpeg2_cuvid", "mpeg4", "mpeg4_cuvid", "msmpeg4", "vc1_qsv", "vc1_cuvid", "vp8", "libvpx", "vp8_cuvid", "vp8_qsv", "vp9", "libvpx-vp9", "vp9_cuvid", "vp9_qsv", "aac", "ac3", "flac", "mp3"]
[13:43:37] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available encoders: ["libx264", "h264_amf", "h264_nvenc", "h264_qsv", "h264_v4l2m2m", "h264_vaapi", "libx265", "hevc_amf", "hevc_nvenc", "hevc_qsv", "hevc_vaapi", "mpeg4", "msmpeg4", "libvpx", "libvpx-vp9", "aac", "libfdk_aac", "ac3", "flac", "libmp3lame", "libopus", "libvorbis", "srt"]
[13:43:37] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available filters: ["deinterlace_qsv", "deinterlace_vaapi", "hwupload_cuda", "hwupload_vaapi", "overlay_opencl", "overlay_qsv", "overlay_vaapi", "overlay_cuda", "procamp_vaapi", "scale_cuda", "scale_opencl", "scale_qsv", "scale_vaapi", "tonemap_cuda", "tonemap_opencl", "tonemap_vaapi", "vpp_qsv", "yadif_cuda", "zscale", "alphasrc"]
[13:43:37] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available hwaccel types: ["cuda", "vaapi", "qsv", "drm", "opencl", "vulkan"]
[13:43:38] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: /usr/lib/jellyfin-ffmpeg/ffmpeg
[13:43:38] [INF] [1] Emby.Server.Implementations.ApplicationHost: ServerId: 4f10b4eef69748429bdaf947fb64a378
[13:43:38] [INF] [1] Emby.Server.Implementations.ApplicationHost: Executed all pre-startup entry points in 0:00:00.0749906
[13:43:38] [INF] [1] Emby.Server.Implementations.ApplicationHost: Core startup complete
[13:43:38] [INF] [1] Emby.Server.Implementations.ApplicationHost: Executed all post-startup entry points in 0:00:00.1478157
[13:43:38] [INF] [1] Main: Startup complete 0:00:09.659414
[13:43:38] [INF] [15] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /data/media/eBooks
[13:43:38] [INF] [10] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /data/media/YouTube/HomeAutomation
[13:43:38] [INF] [13] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /data/media/Movies
[13:43:38] [INF] [8] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /data/media/TV Shows
[13:43:38] [INF] [14] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /data/media/YouTube/Homelab
[13:43:38] [INF] [11] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /data/media/YouTube/BBQ
[13:43:38] [INF] [19] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /data/media/YouTube/Infantil
[13:43:38] [INF] [20] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /data/media/YouTube/Kitchen
[ls.io-init] done.
[13:43:40] [INF] [20] Emby.Server.Implementations.ScheduledTasks.TaskManager: StartupTrigger fired for task: Update Plugins
[13:43:40] [INF] [20] Emby.Server.Implementations.ScheduledTasks.TaskManager: Queuing task PluginUpdateTask
[13:43:40] [INF] [19] Emby.Server.Implementations.ScheduledTasks.TaskManager: Executing Update Plugins
[13:43:41] [INF] [20] Emby.Server.Implementations.ScheduledTasks.TaskManager: Update Plugins Completed after 0 minute(s) and 1 seconds
[13:43:41] [INF] [20] Emby.Server.Implementations.ScheduledTasks.TaskManager: ExecuteQueuedTasks
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

aptalca commented 1 year ago

This is not a container or jellyfin issue. You can ask for help from NPM devs, or you can ask in our discord for community help.

Jellyfin works with our reverse proxy solution SWAG, with the built in proxy conf. Here's a helper document on 502 errors: https://docs.linuxserver.io/general/swag#502

miguelarios commented 1 year ago

Jellyfin works with our reverse proxy solution SWAG, with the built in proxy conf. Here's a helper document on 502 errors: https://docs.linuxserver.io/general/swag#502

The link did it. Thanks. Just erased the proxy host and redid it. It must have been a caching thing.