Jellyfin Forum
SOLVED: Jellyfin getting confused by symlinks? - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: SOLVED: Jellyfin getting confused by symlinks? (/t-solved-jellyfin-getting-confused-by-symlinks)



Jellyfin getting confused by symlinks? - elbekko - 2024-05-10

Hi, trying to install Jellyfin for the first time, and having some issues.

Setup: Synology DS 1517+, DSM7.1.1, Jellyfin 10.8.13 running in a Docker container, using this image.

I can add certain folders fine for indexing, but Jellyfin appears to have a problem with folders that have a symlink pointing to them?
It's very strange.

At some point, because Plex didn't want to scan the same folder twice, I set up a symlink to my DownloadStation folder, so it could pick up both movies and TV shows. This worked fine.

Jellyfin sees both folders (DownloadStation and DownloadStation_link1):
   

But when clicking on the DownloadStation folder, the selection isn't saved, and the following is logged:
Code:
[2024-05-10 08:15:18.232 +00:00] [ERR] [66] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request: "Too many levels of symbolic links : '/mnt/Disk/Downloads/DownloadStation/DownloadStation_link1'". URL "GET" "/Environment/DirectoryContents".

When I add it manually, the following is logged when indexing:
Code:
[2024-05-08 06:28:14.272 +00:00] [ERR] [86] MediaBrowser.Controller.Entities.BaseItem: Error refreshing owned items for "/mnt/Disk/Downloads/DownloadStation"
System.IO.IOException: Too many levels of symbolic links : '/mnt/Disk/Downloads/DownloadStation/DownloadStation_link1'
  at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
  at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
  at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
  at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
  at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileSystemMetadata(FileSystemInfo info)
  at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()
  at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd[TArg](TKey key, Func`3 valueFactory, TArg factoryArgument)
  at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)

Now, note how it's complaining about the linked folder, although it's the main folder I'm selecting... very strange.

Everything seems to be normal on the filesystem (shell inside the Docker container):
Code:
root@jellyfin-jellyfin1:/mnt/Disk/Downloads# ls -l
total 3412
-rwxrwxrwx    1 1025 users    115 Dec 12  2009 crontab
drwxrwxrwx    6 1025 users  12288 Apr 22  2015 downloadscript
drwxrwxrwx 1361 1024 users  167936 May  9 23:36 DownloadStation
lrwxrwxrwx    1 1024 users      15 Feb 19  2019 DownloadStation_link1 -> DownloadStation
drwxrwxrwx 2809 1024 users  163840 Jan  6  2018 DownloadStation_ToSort
drwxrwxrwx    2 root users    4096 Apr  1  2013 @eaDir
-rwxrwxrwx    1 1025 users 3115520 Sep 11  2011 Thumbs.db
drwxrwxrwx    3 1025 users  16384 Mar 21 22:30 torrents
root@jellyfin-jellyfin1:/mnt/Disk/Downloads# stat DownloadStation
  File: DownloadStation
  Size: 167936          Blocks: 336        IO Block: 4096  directory
Device: fc00h/64512d    Inode: 43517890    Links: 1361
Access: (0777/drwxrwxrwx)  Uid: ( 1024/ UNKNOWN)  Gid: (  100/  users)
Access: 2034-05-17 18:01:21.578040469 +0000
Modify: 2024-05-09 23:36:35.896809245 +0000
Change: 2024-05-09 23:36:35.896809245 +0000
Birth: -
root@jellyfin-jellyfin1:/mnt/Disk/Downloads# stat DownloadStation_link1
  File: DownloadStation_link1 -> DownloadStation
  Size: 15              Blocks: 0          IO Block: 4096  symbolic link
Device: fc00h/64512d    Inode: 738066601  Links: 1
Access: (0777/lrwxrwxrwx)  Uid: ( 1024/ UNKNOWN)  Gid: (  100/  users)
Access: 2034-05-17 17:58:53.490031558 +0000
Modify: 2019-02-19 18:19:44.093412443 +0000
Change: 2019-02-19 18:19:44.093412443 +0000
Birth: -

I've also tried mounting the DownloadStation folder directly in Docker, and the same error occurs when selecting it in Jellyfin Confused-face

Any ideas? I'd rather not have to change the setup too much to not break Plex just yet.


RE: Jellyfin getting confused by symlinks? - gnattu - 2024-05-10

Why you are having DownloadStation_link1 inside the DownloadStation folder and pointing to DownloadStation itself? It is an infinite loop isn't it?


RE: Jellyfin getting confused by symlinks? - elbekko - 2024-05-10

Oh motherf... Thanks for that, no idea how that ever got there, it's supposed to be alongside it.

Removed that link and now it works. Guess I need to get my eyes checked /facepalm