Jellyfin Forum
Jellyfin deletes all media metadata when unable to access media filles - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Jellyfin deletes all media metadata when unable to access media filles (/t-jellyfin-deletes-all-media-metadata-when-unable-to-access-media-filles)



Jellyfin deletes all media metadata when unable to access media filles - cthunsfrd - 2024-05-13

Jellyfin server deletes all metadata during restart if unable to access media files.
Because my media files are on another server and Jellyfin server access these files through local ethernet.
These files are not always accessable if the server is not up or network error.
This is not a problem if Jellyfin server keeps on as I disabled filesystem monitoring.
When connection restores, I can access my movies again on Jellyfin server.
But if Jellyfin server restarts at this time,I loses all midia metadata, Jellyfin server deletes all at startup.
Is there any way to keep the metadata if media files are not accessable when restarting Jellyfin?


RE: Jellyfin deletes all media metadata when unable to access media filles - TheDreadPirate - 2024-05-13

What OS is the jellyfin server running? If it is Linux there are ways to modify the service file to wait for certain conditions before starting Jellyfin.


RE: Jellyfin deletes all media metadata when unable to access media filles - cthunsfrd - 2024-05-14

Server OS: Centos7.9(runs on esxi6.7)
Jellyfin version : 10.8.10

Media files are mouted via cifs during server startup


RE: Jellyfin deletes all media metadata when unable to access media filles - TheDreadPirate - 2024-05-14

In the service file you can add "RequiresMountsFor=/your/cifs/mount/path"

The service file is located at

/etc/systemd/system/multi-user.target.wants/jellyfin.service

Using my service file as an example, you would add RequiresMountFor like this.

Code:
[Unit]
Description = Jellyfin Media Server
After = network-online.target

[Service]
RequiresMountsFor=/media/library
Type = simple
EnvironmentFile = /etc/default/jellyfin
User = jellyfin
Group = jellyfin
WorkingDirectory = /var/lib/jellyfin
ExecStart = /usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS
Restart = on-failure
TimeoutSec = 15
SuccessExitStatus=0 143

[Install]
WantedBy = multi-user.target



RE: Jellyfin deletes all media metadata when unable to access media filles - cthunsfrd - 2024-05-15

Thanks, It works perfect,
after reboot jellyfin server keeps running but no longer deletes any metadata now.


RE: Jellyfin deletes all media metadata when unable to access media filles - AntonyF - 2025-01-14

Hi there, after my collections data keeps disappearing I've worked out from threads here and the above info that the issue is I'm using Windows, Windows reboots whenever the damn well hell it wants and my media is on mounted drivers for which I need to provide passwords.

So the drives aren't accessible on reboot, and the collections are wiped.

Is there a Windows equivalent of the above, the RequireMounts thing? Or a suggested solution? I guess I could just tell Jellyfin not to start on boot, but wondered if there was a preferred solution.

Thanks in advance!


RE: Jellyfin deletes all media metadata when unable to access media filles - TheDreadPirate - 2025-01-14

I don't think there is an equivalent solution. The issue the OP of this thread had was a matter of startup order. Jellyfin was starting before another process connected to their network storage. So we configured Jellyfin to wait a bit for those processes to finish before starting Jellyfin.

Your circumstance requires you to enter a password to, I assume, decrypt the drives. And I'm not sure there is any other solution other than to, as you stated, configure Jellyfin to not start on boot.


RE: Jellyfin deletes all media metadata when unable to access media filles - theguymadmax - 2025-01-14

(2025-01-14, 12:00 PM)AntonyF Wrote: Hi there, after my collections data keeps disappearing I've worked out from threads here and the above info that the issue is I'm using Windows, Windows reboots whenever the damn well hell it wants and my media is on mounted drivers for which I need to provide passwords.

So the drives aren't accessible on reboot, and the collections are wiped.

Is there a Windows equivalent of the above, the RequireMounts thing? Or a suggested solution? I guess I could just tell Jellyfin not to start on boot, but wondered if there was a preferred solution.

Thanks in advance!

There’s a task that runs on startup to remove items from collections and playlists if they aren’t detected. You can find it in the Dashboard under Scheduled Tasks – look for "Clean up collections and playlists" under "Maintenance".

To stop it from running on startup, simply delete the "on application startup" trigger. After that, you can either manually run the task or set your own custom trigger.


RE: Jellyfin deletes all media metadata when unable to access media filles - AntonyF - 2025-02-01

Thank you, much appreciated!