Jellyfin not working with NAS

Hi everyone,

I can’t play any media from my Nas(Fritzbox nas) on Jellyfin installed on DP on an Orange pi 5.

It is my understanding that you can’t directly add the NAS in Jellyfin but you have to mount the NAS on dietpi first. Adding it with the drive manager did not work but adding it with the command line did work:

sudo mount -t cifs -o username=myname,password=********** //fritz.box/fritz.nas /mnt/smbshare also added the mounted drive to fstab so it mounts everytime I boot.

In Jellyfin and the DP intergrated file manager I can now see the the server and I can also navigate through the folders. However automatically looking for metadata or playing any content does not work. At first I thought this was some encoding issue but when I added the same media to my library from my a local usb stick, everything worked, videos and audio.

This is the error message I get in Jellyfin:

Playback Error
This client isn’t compatible with the media and the server isn’t sending a compatible media format.

Next thought I had was file permissions I ran
sudo chmod -R a+rwX /mnt/smbshare

But that also could not fix the issue.
I would be grateful for any ideas on how to solve this issue
I posted the log from Jellyfin below, please let me know if I should provide any additional information.

Required Information

  • DietPi version | G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=15
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
  • Distro version | bullseye
  • Kernel version | Linux DietPi 5.10.110-rockchip-rk3588 #23.02.2 SMP Fri Feb 17 23:59:20 UTC 2023 aarch64 GNU/Linux
  • SBC model | Orange Pi 5 (aarch64)
  • Power supply used | (5V 40A )
  • SD card used | (SanDisk Extreme 128GB)

Additional Information (if applicable)

  • Software title | Jellyfin
  • Was the software title installed freshly or updated/migrated?
    freshly
  • Can this issue be replicated on a fresh installation of DietPi?
    just I this is a completely fresh install
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | echo $G_HW_UUID
    e6d7d302-1fce-4212-8443-9966ae97a12d

Steps to reproduce

Add media from a FritzBox NAS on Jellyfin

Expected behaviour

Jellyfin should be able to play media from a NAS on Dietpi

Actual behaviour

Playback error

#### Extra details
logfiles from Jellyfin when I try to play a music file: 
[2023-03-22 20:00:23.078 +01:00] [ERR] Error processing request: "Stale file handle : '/mnt/smbshare/Mass-StorageDevice-01/Musik/Queens of the Stone Age - Villains (2017) [CD FLAC]/08. The Evil Has Landed.flac'". URL "GET" "/Audio/c9fcb9377a22aeef0e653bde968a1d87/universal".
[2023-03-22 20:00:23.081 +01:00] [ERR] Connection id ""0HMPB0FB1H131"", Request id ""0HMPB0FB1H131:00000006"": An unhandled exception was thrown by the application.
System.InvalidOperationException: Response Content-Length mismatch: too few bytes written (25 of 47292459).
[2023-03-22 20:00:23.291 +01:00] [INF] Playback stopped reported by app "Jellyfin Web" "10.8.9" playing "08. The Evil Has Landed". Stopped at "0" ms
[2023-03-22 20:00:23.317 +01:00] [ERR] Error encoding image

What was the issue to mount your Samba share using Drive Manager?

This will have zero effect because Samba share don’t support Linux file system permission

thanks a lot for reading through all that!

I guess the error with the drive manager was my own fault, maybe just a typo or a wrong formatting of the NAS adress.

I eventually asked chat gpt how to mount this drive with my username and pw and that worked. I can also see the mounted smb share in the drive manager now.

and sorry I didn’t know that the smb doesn’t support Linux file system permission.

I noticed all the drives are formatted NTFS, should I maybe try to reformat them as EXT4 or BTRFS ?

the file system format on server side has no effect to how the Samba share will be nounted on client side. Simply you can change or adjust file system permssions on a Samba client share. For testing you could unmount current share and add it again using drive manager. We set some options in addition to what you have done manually. But not sure if this will change thinks.

Thanks a lot!

I have just unmounted and remounted the NAS using the drive manager.
My mistake was the “///” before “fritz.box” and the pointing the drive manager to the folder “fritz.nas/”.

So the mount was successful but Jellyfin still still has the same issues with the NAS
I also tried the benchmark option which resulted in 0 MiB/s write and read. so I guess there is still something I’m doing wrong.

On command line, are you able to read/write files from and to the Samba share?

sorry I did not try to move anything with the command line, as I’m not too familiar with it yet.
But I just tried to do it with the DP file manager. I moved the .profile from the home directory to the mounted NAS which did not work.

Is there still something I could try or do you think this is an issue with the FritzBox itself?

It’s best to use the IP for the mount point rather than a DNS entry…

Also…put the credentials for login in a file that can be chmodded for 600 so others can’t see it (even though it’s on your own home network)

Here is how I did my mapping for my Tdarr node’s, mapped the sharing for movies and tv shows plus the encoding share to

in my /etc/fstab file

//192.168.0.8/movies /mnt/user/movies cifs credentials=/etc/cifsauth,uid=1000,gid=1000,iocharset=utf8,file_mode=0744,dir_mode=0744,noperm 0 0

Since I wanted the files to be mounted for read only (so I don’t accidentally delete them from my remote server, I told it to use file and directories as 744, and mounted the directories as my user so it’s ownership (of the jellyfin server user) would be the same

Also…make sure you have cifs-utils installed as well

You could login as user root and use cp command to copy files from and to your Samba share. A very basic how-to attached The Linux cp Command – How to Copy Files in Linux

Are there any errors if you try to copy files?

Ok so I tried to remount the NAS with the ip adress (192.168.178.1) instead of fritz.box as WarHawk suggested.
I still have access to the files via the dietpi file manager, but copying files with it or with the command line does not work. In the command line I get the error access to stat for file not found: file or destination not found [translated]

can you share/copy the original error message directly from SSH terminal? Don’t worry if it is in German.

I mounted the NAS with the IP adress and the folder, with worked but I still have the same issue sadly. But thanks a lot for the suggestion!

About the fstab file, I thought Dietpi would handle creating the fstab file automatically?

so I retried it, but this time I chose a folder that does not have any spaces or special characters and I got this:

root@DietPi:/mnt/samba/Mass-StorageDevice-01/Musik/AMK-ANK-FLAC/AMK-ANK-FLAC# cp folder.jpg /root
cp: 'folder.jpg' kann nicht zum Lesen geöffnet werden: Veraltete Dateizugriffsnummer (file handle)

you guessed it, it is in German, sorry about that.

it is automatically created by drive manager, no need to do it manually.

Don’t worry we understood German very well :wink:

Are you able to connect the USB stick from FritzBox directly on your SBC? Maybe there some file system issues on the stick.

perfect! :blush:
I was able to connect the drive that is connected to the fritzbox to the orange pi 5 and everything in Jellyfin works. Also other drives work perfectly if mounted directly.

if possible, try to plug the stick only (not mounted) and perform some file system check. If the drive is unmounted, you should have an option in drive manager to check & repair.

I tried that but it seems like the drive is healthy:

Mounting volume... OK                                                        │
│ Processing of $MFT and $MFTMirr completed successfully.                      │
│ Checking the alternate boot sector... OK                                     │
│ NTFS volume version is 3.1.                                                  │
│ NTFS partition /dev/sda1 was processed successfully.

As you might have figured out by now I am not an expert, but I guess since

  • I can access, read and write the NAS through a filemanager on my computer/ phone
  • Jellyfin works completely fine with drives plugged in directly
  • If the NAS is mounted on dietpi I can see the folder/files but not really read/ write

My guess is that there is something wrong with the mouting of the NAS in dietpi
Would you agree?

partially, Samba client is one of the most popular software on DietPi. Therefore it’s not something in general but probably dedicated to how the share is exported by FritzBox/AVM. I did some testing based on FritzNAS unter Linux mounten | andwil.de and found a value that would need to be set in addition

  1. umount the samba share
umount /mnt/samba/
  1. open /etc/fstab
nano /etc/fstab
  1. add value noserverino into the line for your samba share like this
  • before
cred=/var/lib/dietpi/dietpi-drive_manager/mnt-samba.cred,iocharset=utf8,
  • after
cred=/var/lib/dietpi/dietpi-drive_manager/mnt-samba.cred,noserverino,iocharset=utf8,
  1. save and leave the file
  2. mount the share again
mount -a
mount /mnt/samba
  1. try to access a file.

I was testing using FB7590 running 7.50

2 Likes

you are one crazy MF.

Not only was this exactly the same FritzBox (7590) with the same firmware that I am using but this solution also fixed everything! Yay I can finally use my NAS!

Thanks a lot for all your help and reading through my spam

Can I buy you a beer?

1 Like

of course you can support our little project Contribute to DietPi :smiley: