Migrating jellyfin off truenas scale to mini PC. questions about permissions

I want to take jellyfin off of my NAS and put it on a separate device running unbuntu server.

I believe the steps should be:

  1. On Truenas:
    a. share the relevant datasets via NFS
    b. (?) Create a user\group and grant permissions to access the NFS share

  2. On the client:
    a. install dockge & jellyfin
    b. mount the NFS share to folder(s)
    c. specify the mount points in the client compose.yaml script

Does that sound correct?

I’ve gotten everything working execpt step 1b. I cannot figure out how to get the client jellyfin app to access the NFS share on truenas.

Here’s the jellyfin compose script from when everything worked fine running entirely on the NAS :

services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    environment:
      - PUID=950
      - PGID=950
    volumes:
      - /mnt/pool1/docker/data/Jellyfin/config:/config
      - /mnt/pool1/docker/data/Jellyfin/transcodes:/config/data/transcodes
      - /mnt/pool1/library:/data
      - /mnt/pool1/library/shows:/data/shows
      - /mnt/pool1/library/movies:/data/movies
    ports:
      - 8096:8096
    restart: unless-stopped
networks: {}

And here’s my jellyfin script on the mini PC

services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    environment:
      - PUID=1000
      - PGID=1000
      - JELLYFIN_PublishedServerUrl=xxxxxxxx:8096
    volumes:
      - /mnt/truenas_media:/config
      - /mnt/truenas_media/shows:/data/shows
      - /mnt/truenas_media/movies:/data/movies
    ports:
      - 8096:8096
    restart: unless-stopped
networks: {}

Note: /mnt/pool1/library on the NAS is mapped to /mnt/truenas_media on the client.

The good news

I can traverse my NAS library folders through my client terminal. I take that to mean my client account has no problems reading these datasets.

The Bad news

Jellyfin cannot start. Dockge terminal looks like this:

jellyfin  |    at System.IO.FileSystem.CreateDirectory(String fullPath, UnixFileMode unixCreateMode)
jellyfin  |    at System.IO.Directory.CreateDirectory(String path)
jellyfin  |    at Jellyfin.Server.Helpers.StartupHelpers.CreateApplicationPaths(StartupOptions options)
jellyfin  |    at Jellyfin.Server.Program.StartApp(StartupOptions options)
jellyfin  |    at Jellyfin.Server.Program.<Main>(String[] args)
jellyfin  | Unhandled exception. System.UnauthorizedAccessException: Access to the path '/config/data' is denied.
jellyfin  |  ---> System.IO.IOException: Permission denied
jellyfin  |    --- End of inner exception stack trace ---

I do see the difference between mounting the /mnt/pool1/docker... and /mnt/pool1/library directories. I initially tried to be clever and copy over docker stacks directories in attempts to avoid rebuilding the database. that became its own headache that I wasn’t smart enough to figure out. I imagine it’s easier to just rebuild things directly on the client.

I’d bet this is where the issue lies is, but I’m bit frustrated after all the trouble and somewhat out of my depth.

Hoping this is an embarrassingly easy tweak to get things talking to each other. Thanks for your time!

On the remote side, you can create Docker volume using the NFS volume as the source, via something like docker volume create --driver local --opt type=nfs --opt addr=<IP of your TrueNAS>,rw --opt device=:/path/to/NFS/shared/dataset --opt o=nfsvers=3 nfs-jellyfin-data. Then you can use that volume in your compose volume definition.

Also, unless you enable non-root NFS on the TrueNAS side, all the access will be as root.

I’m not super familiar with docker and really have only gotten this far thanks to Dockge and script kiddie intuition. The issue appears to be problems with remote jellyfin being blocked from accessing /config/data .

Looking at how things are mapped, /config on remote resolves to /mnt/pool1/library on the NAS, which has no data subfolder.

maybe it’s looking for /opt/stacks/jellyfin/config? That’s the “correct” file path on the remote device.

If it helps, I’m mounting the NFS dataset in /etc/fstab as

<TRUENAS_IP>:/mnt/pool1/library /mnt/truenas_media nfs defaults,rw,user,nofail,hard,intr 0 0

And I’m sharing the library and some children datasets individually

Not sure if having the child datasets as their own NFS shares helps or hurts.

Is that something I should change? sounds like a potential security risk. This is a low concern since I am not opening traffic outside my LAN.

Unfortunately, I’m not familiar with Jellyfin’s preferred folder layout, but if you want your non-root user/group to be able to mount NFS, you’ll need to enable non-root mount.