• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Jellyfin only sees my files if I restart it manually

     
    • 0 Vote(s) - 0 Average

    Jellyfin only sees my files if I restart it manually

    haigha
    Offline

    Junior Member

    Posts: 3
    Threads: 1
    Joined: 2025 Mar
    Reputation: 0
    Country:United States
    #1
    2025-03-06, 05:17 AM
    Let me say before I begin, that I can get around in Linux, but I'm definitely not an expert.

    I have a Synology DS224+ where I'm storing my media and Jellyfin config files.  I've also been running Jellyfin in a container on the NAS, but it just gets too slow and I have to reboot it about once a week to restore playability.  I have a Windows desktop from which I upload media files to the NAS.

    I have a beat-up, mostly functional laptop (dead screen) that will hopefully be better for serving Jellyfin.  I've installed Ubuntu LTS, docker (compose), and an image of Jellyfin (it is lscr.io/linuxserver/jellyfin, to match what was on the NAS, but I don't think that matters for this case).

    The issue I'm stuck on is that if I start the server up, docker runs, the Jellyfin server starts automatically, and I can see it, but it thinks it's a new install.  If I exec into the instance, both the /config and /data/media folders are ephemeral, not the mounted versions that they are being pointed to in the compose.yaml.  If I bring the instance down, and then bring it back up, it runs great.  The /config and /data/media folders both look like they should, and the web UI brings up all of the media that I would expect.

    I don't even know what kind of problem this points to.  Something to do with the user that it runs under automatically (root I assume) vs my user?  That doesn't make sense to me, since shouldn't root be able to see everything I can?  I obviously am not matching something up somewhere, but I've looked and searched everything I can think of.

    Here's some of my config.  Please let me know if anything else would be useful:

    /etc/fstab
    192.168.1.102 is the NAS.  1026 and 100 are the uid and gid already present on the folders and files on the NAS
    I can always see the expected content in this mount point as a user, but Jellyfin only sees it if I restart the instance manually.
    Code:
    //192.168.1.102/data /media/NAS cifs username=jellyfin,password=jellyfin,rw,uid=1026,gid=100

    /opt/compose.yaml
    Code:
    ---
    services:
      jellyfin:
        image: lscr.io/linuxserver/jellyfin:latest
        container_name: jellyfin
        environment:
          - PUID=1026
          - PGID=100
          - UMASK=022
          - TZ=America/New_York
          - JELLYFIN_PublishedServerUrl=192.168.1.103
        volumes:
          - type: bind
            source: /media/NAS/jellyfin
            target: /config
          - type: bind
            source: /media/NAS/media
            target: /data/media
        devices:
          - /dev/dri/renderD128:/dev/dri/renderD128
          - /dev/dri/card0:/dev/dri/card0
        ports:
          - 7359:7359/udp  # client discovery
          - 8096:8096/tcp  # web ui
        restart: always

    Mounted directories as a user
    Code:
    mike@services:~$ ls -l /media/NAS
    total 0
    drwxr-xr-x 2 1026 users 0 Feb 11 22:24 jellyfin
    drwxr-xr-x 2 1026 users 0 Feb  4  2024 media

    mike@services:~$ ls -l /media/NAS/jellyfin
    total 32
    -rwxr-xr-x 1 1026 users  263 May 19  2024 branding.xml
    drwxr-xr-x 2 1026 users    0 Feb  3 23:00 cache
    drwxr-xr-x 2 1026 users    0 May 19  2024 data
    drwxr-xr-x 2 1026 users    0 Feb  4  2024 dlna
    -rwxr-xr-x 1 1026 users 2870 Mar  5 05:14 encoding.xml
    drwxr-xr-x 2 1026 users    0 Mar  5 05:13 log
    -rwxr-xr-x 1 1026 users 1362 Feb  4  2024 logging.default.json
    -rwxr-xr-x 1 1026 users  261 Jan 18 16:18 metadata.xml
    -rwxr-xr-x 1 1026 users 3955 Mar  5 05:14 migrations.xml
    -rwxr-xr-x 1 1026 users 1083 May 11  2024 network.xml
    -rwxr-xr-x 1 1026 users 6852 Feb 11 22:23 system.xml
    drwxr-xr-x 2 1026 users    0 Feb  5  2024 users

    mike@services:~$ ls -l /media/NAS/media
    total 0
    drwxr-xr-x 2 1026 users 0 Mar  5 15:41 movies
    drwxr-xr-x 2 1026 users 0 Oct 17 22:39 music
    drwxr-xr-x 2 1026 users 0 Feb 27 17:06 tv
    mike@services:~$

    Looking inside the instance with "docker exec -it jellyfin /bin/bash"
    Note that /config is the default version and /data/media is empty
    Code:
    root@55d802b86f4d:/# ls -l /config
    total 22832
    drwxr-xr-x 3 abc users    4096 Mar  2 21:53 cache
    drwxr-xr-x 7 abc users    4096 Mar  2 19:31 data
    -rw-r--r-- 1 abc users    2645 Mar  2 23:41 encoding.xml
    drwxr-xr-x 2 abc users    4096 Mar  5 00:00 log
    -rw-r--r-- 1 abc users    1362 Mar  2 19:31 logging.default.json
    -rw-r--r-- 1 abc users 23351281 Mar  5 23:58 migrations.xml
    -rw-r--r-- 1 abc users    6753 Mar  2 19:47 system.xml

    root@55d802b86f4d:/# ls -l /data/media
    total 0

    If I go to the web UI, I get the setup screen.

    Restart the instance
    dcdown and dcup are aliases:
    alias dcup='docker compose -f /opt/compose.yaml up -d' #brings up all containers if one is not defined after dcup
    alias dcdown='docker compose -f /opt/compose.yaml stop' #brings down all containers if one is not defined after dcdown
    Code:
    mike@services:~$ dcdown jellyfin
    [+] Stopping 1/1
    ✔ Container jellyfin  Stopped                                                                                                                                                                                                        10.3s
    mike@services:~$ dcup jellyfin
    [+] Running 1/1
    ✔ Container jellyfin  Started 

    The directories within the instance now match the mounted version
    I know ubuntu shows the group 100 as "users".  I'm assuming the "abc" user is 1026 inside the instance.
    Code:
    root@55d802b86f4d:/# ls -l /config
    total 32
    -rwxr-xr-x 1 abc users  263 May 19  2024 branding.xml
    drwxr-xr-x 2 abc users    0 Feb  3 18:00 cache
    drwxr-xr-x 2 abc users    0 May 19  2024 data
    drwxr-xr-x 2 abc users    0 Feb  4  2024 dlna
    -rwxr-xr-x 1 abc users 2870 Mar  6 00:04 encoding.xml
    drwxr-xr-x 2 abc users    0 Mar  6 00:03 log
    -rwxr-xr-x 1 abc users 1362 Feb  4  2024 logging.default.json
    -rwxr-xr-x 1 abc users  261 Jan 18 11:18 metadata.xml
    -rwxr-xr-x 1 abc users 3955 Mar  6 00:04 migrations.xml
    -rwxr-xr-x 1 abc users 1083 May 11  2024 network.xml
    -rwxr-xr-x 1 abc users 6852 Feb 11 17:23 system.xml
    drwxr-xr-x 2 abc users    0 Feb  4  2024 users

    root@55d802b86f4d:/# ls -l /data/media
    total 0
    drwxr-xr-x 2 abc users 0 Mar  5 10:41 movies
    drwxr-xr-x 2 abc users 0 Oct 17 18:39 music
    drwxr-xr-x 2 abc users 0 Feb 27 12:06 tv

    Now going to the web UI shows my user screen with the movies, shows, music, etc.  I can even successfully edit the config (adding a login message through the UI, shows up in the branding.xml file on the NAS).

    If anyone has any idea what I'm not seeing here, I'd appreciate the insight.

    Thanks
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2025-03-06, 01:45 PM
    When using network storage, each device is completely unaware of each others users, except the credentials used to authenticate (username/password).

    The UID and GID fields are used for controlling which users on the local system are allowed to access the share.  If UID 1026 and GID 100 don't correspond to an actual user on the client device (your laptop), then Jellyfin will only have read permissions.

    Backing up a bit, DO NOT put /config on a network share.  That is a recipe for a very bad time.  SQLite, Jellyfin's DB provider, does not tolerate latency well.  Even the miniscule latency on a LAN connection.

    /config MUST be on a local disk.  You should also provide a path for /cache.  It isn't strictly necessary, but having static (and local) storage for /cache will help with consistency when you upgrade the container (which will wipe any ephemeral storage).

    And going back to the network storage issue.  You can either provide an actual user that exists on the laptop in the fstab parameters, and run Jellyfin as that user, or you can remove the UID and GID files and add "noperm" to the options.  This will configure the mount to allow all users on the laptop to have read/write access to the mounted CIFS share.  Assuming the "username" provided has sufficient access on the server.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    haigha
    Offline

    Junior Member

    Posts: 3
    Threads: 1
    Joined: 2025 Mar
    Reputation: 0
    Country:United States
    #3
    2025-03-06, 08:35 PM
    Hi TheDreadPirate, thanks for your response.

    The information about the /config is good to know. Since Jellyfin was on the NAS, the /config was already there, so I kept it there. I'll move it once I have the rest of it working.

    There may be some confusion. I'm not having issues with read/write. Once Jellyfin can see the share, it is able to read/write. The problem is that it doesn't see the mounted directories until it is restarted.

    I did try implementing the changes you mentioned. Unfortunately, adding noperm to the fstab and removing the UID and GID lines from the compose didn't change anything. Everything shows up as being owned by root:root now, but the behavior hasn't changed. I still have to manually restart the Jellyfin instance to get it recognize the shares.

    As a follow up, I changed both the fstab and compose.yaml to use 1000:1000, which should be me, and while the shown owners of the files changed to my user id and group, no actual behavior changed.

    Thanks
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2025-03-07, 03:23 PM
    Are you able to see if the network share dropped out at any point? Even briefly?

    Not sure which log you'd see that in. Maybe the docker daemon log?

    Code:
    sudo journalctl -u docker -n 500 --no-pager > /tmp/dockerLog.txt

    Share the file that creates via privatebin.net
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    haigha
    Offline

    Junior Member

    Posts: 3
    Threads: 1
    Joined: 2025 Mar
    Reputation: 0
    Country:United States
    #5
    2025-03-08, 09:47 PM
    It occurred to me that this might be a timing thing, and it does appear that Docker/Jellyfin was coming up before the system was mounting the shares.

    For anyone finding this later:

    - Since my system uses systemd, it apparently creates ".mount" entries for each of the entries in the fstab file.  Using systemctl list-units -t mount let me find the name of this (mnt-media-nas.mount).
    - Now I could run systemctl edit docker.service to add:

    Code:
    [Unit]
    Requires=mnt-media-nas.mount
    After=mnt-media-nas.mount

    Now this apparently makes docker wait until that mount has finished mounting.  I've rebooted a number of times, and it is now working without any issues.

    I did go back and do some of the best practices that TheDreadPirate recommended, such as moving /cache and /config to a local folder (/jellyfin/cache and /jellyfin/config).  I also really disliked the "/media/NAS/media" thing that I got from another post and moved it to "/mnt/nas/media", which felt like a better match.

    Thanks!
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode