[BUG] JELLYFIN_CONFIG_DIR=/config makes .NET watch the entire /config tree (incl. metadata), exhausting inotify watches

未关闭
#341 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp, docker, dockerfile, linux

调研方向

Start with the svc-jellyfin run script, where JELLYFIN_CONFIG_DIR is exported as /config, and with the Dockerfile that sets the default config path. Confirm the watch count by comparing inotify watches to the directories under /config. Done means Jellyfin only watches its config files, with existing installs migrated safely, and the choice between a /config/config subfolder and a Dockerfile-level override is settled first.

由索引模型根据 Issue 内容生成。

描述

no-issue-activity
Is there an existing issue for this?
  • I have searched the existing issues

Related: #331 (same symptom, attributed to real-time monitoring) and #22 (config path differs from the official image).

Current Behavior

The svc-jellyfin run script exports JELLYFIN_CONFIG_DIR="/config". Jellyfin registers its logging config with SetBasePath(appPaths.ConfigurationDirectoryPath) and AddJsonFile(..., reloadOnChange: true) (Jellyfin.Server/Program.cs ~L400-403). On Linux, .NET's physical file provider watches that base path recursively (one inotify watch per subdirectory). With the config dir set to /config, that includes /config/data/metadata, /config/cache, etc.

Measured on a host running linuxserver/jellyfin 12.2:

  • /config/data/metadata holds ~96,000 directories (mostly People/*).
  • The Jellyfin process holds 117,465 inotify watches, all on the /config filesystem (sampled inodes resolve to /config and /config/data/metadata/People/...).
  • Disabling real-time monitoring on every library and restarting changes nothing (still 117,465).
  • Because the limit is per UID, other containers running as the same PUID run out of watches. In our case Plex's EasyAudioEncoder failed with EAE timeout! EAE not running, or wrong folder?.

This is why #331 saw exhaustion that did not go away with real-time monitoring settings.

Expected Behavior

Only Jellyfin's actual config files (system.xml, logging*.json, ...) are watched, as with the official image, where the config dir is a dedicated subfolder and the watch count stays small.

Possible backward-compatible fix: point JELLYFIN_CONFIG_DIR at a dedicated folder (e.g. /config/config) with a one-time init step that moves *.xml / logging*.json there if they still sit in /config. Or, as suggested in #22, move the env into the Dockerfile so users can override it.

Steps To Reproduce
  1. Run linuxserver/jellyfin with a library large enough to produce a few thousand metadata folders.
  2. Count watches held by Jellyfin: cat /proc/$(pgrep -f /usr/bin/jellyfin)/fdinfo/* | grep -c '^inotify wd:'
  3. Compare with find /config -xdev -type d | wc -l inside the container: the watch count tracks the total number of directories under /config.
  4. Disable real-time monitoring for all libraries and restart: the count does not change.
Environment
  • OS: Debian-based umbrelOS 2.0 (host 1); Ubuntu 24.04 VPS (host 2, small library, same pattern: ~2 watches per directory under /config)
  • How docker service was installed: distro packages / umbrelOS
CPU architecture

x86-64

Docker creation
services:
  jellyfin:
    image: linuxserver/jellyfin:version-12.2ubu2604
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - ./jellyfin:/config
Container logs
No Jellyfin errors; the effect shows up in other processes under the same UID, e.g. Plex:
[eac3_eae] EAE timeout! EAE not running, or wrong folder? Could not read '/run/plex-temp/.../EasyAudioEncoder/Convert to WAV (to 8ch or less)/...'

Host: fs.inotify.max_user_watches = 122404; watches in use by UID 1000 = 122386 (Jellyfin 117465, Syncthing 4751)

Investigated and written with the help of an AI assistant; all numbers above were measured on my own servers.

主要语言
Dockerfile
星标
909
派生
136
平均合并
4 小时 31 分钟
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

linuxserver/docker-jellyfin 的其他 Issue

查看 linuxserver/docker-jellyfin 的全部 Issue

相似的 Issue

更多 DevOps Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。