Jump to content

Libraries vanish / empty themselves when network path is not directly accessible at startup


NicoLaz
 Share

Recommended Posts

Hi all

Half a year ago, I moved my emby instance from my NAS to a seperate machine (Win10) to get better performance. However, as I'm using emby as a DVR and my library got quite ... ähm ... "comprehensive" by now, I also upgraded my NAS and seperated media server and data storage. I'm using SMP paths in my libraries to add the shared folders to emby (location = \\SERVER\FOLDER1). I had a power outage today and (re-)noticed an odd behaviour of emby: as my media server is a lot faster in booting up as my NAS, accessing the library failed when emby service started. As a result, some of my libraries where just gone from the admin interface and in the remaining ones, nearly all the entries were missing. Restoring my nightly backup did fail as well (I experienced the already known bug with multiple entries after restore) ending up with me deleting all libraries and setting them up again.

Yes, one could think that the settings were damaged by the shutdown, but I already experienced the same behaviour when I shut down the NAS and media server in parallel a few month ago.

Did you experience something similar in the past? If so, it seems that emby doesn't destinguish between "non accessible" and "non existent" when accessing libraries. It might then be a good idea to catch that error and allow some access retries or even "halt" / "pause" a library that can't be accessed instead of just deleting the entries or even the whole library. If not, it might just be my setup and I would appreciate any tips on how to change it to avoid a repetition of that...

Cheers!

Link to comment
Share on other sites

PenkethBoy

too late now but i would invest in a UPS or two to run the pc and nas should you get an outage - at least you can shut down the machines gracefully (automatically) - and let them restart or not

then its a choice if you run as a service or not and let emby auto start or not - i dont - so i can control when things are back online etc

advice after the event is alway great but does not help apart from going forward

I have not lost data due to a network drive going off line as my data is local - although have had the odd HDD disappear on a reboot - but comes back after a power cycle - windows quirks - but as i dont have emby auto start (you could set a delay of say 10-20-30 mins as necessary to cover the NAS taking longer to appear etc)

Lots of things could be done differently depending on need and will etc

Link to comment
Share on other sites

Hi @Luke

Thank you for your fast reply! I wanted to prepare the logs this morning but noticed that they already went into rotation and got deleted :( I didn't realize the timespan was so short, sorry... The only thing I still habe is those two warning messages in the message history - they belong to the two libraries I was missing:

Could not find a part of the path 'C:\Users\cube\AppData\Roaming\Emby-Server\programdata\root\default\Recorded Movies11'.
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
at System.IO.Enumeration.FileSystemEnumerableFactory.FileSystemInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileSystemEntries(String path, Boolean recursive)
at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntries(String path)
at MediaBrowser.Controller.IO.FileData.GetFilteredFileSystemEntries(IDirectoryService directoryService, String path, IFileSystem fileSystem, IServerApplicationHost appHost, ILogger logger, ItemResolveArgs args, Int32 flattenFolderDepth, Boolean resolveShortcuts)
at MediaBrowser.Controller.Entities.CollectionFolder.CreateResolveArgs(IDirectoryService directoryService)
at MediaBrowser.Controller.Entities.CollectionFolder.FolderIdsRequireUpdating(Boolean updateValues)
at MediaBrowser.Controller.Entities.CollectionFolder.BeforeMetadataRefresh(Boolean replaceAllMetdata)
at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.ValidateTopLibraryFolders(Boolean refreshMetadatas, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.PerformLibraryValidation(IProgress`1 progress, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.ValidateMediaLibraryInternal(IProgress`1 progress, CancellationToken cancellationToken)
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)
Could not find a part of the path 'C:\Users\cube\AppData\Roaming\Emby-Server\programdata\root\default\Recordings1'.
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
at System.IO.Enumeration.FileSystemEnumerableFactory.FileSystemInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileSystemEntries(String path, Boolean recursive)
at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntries(String path)
at MediaBrowser.Controller.IO.FileData.GetFilteredFileSystemEntries(IDirectoryService directoryService, String path, IFileSystem fileSystem, IServerApplicationHost appHost, ILogger logger, ItemResolveArgs args, Int32 flattenFolderDepth, Boolean resolveShortcuts)
at MediaBrowser.Controller.Entities.CollectionFolder.CreateResolveArgs(IDirectoryService directoryService)
at MediaBrowser.Controller.Entities.CollectionFolder.FolderIdsRequireUpdating(Boolean updateValues)
at MediaBrowser.Controller.Entities.CollectionFolder.RequiresRefresh()
at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.ValidateTopLibraryFolders(Boolean refreshMetadatas, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.PerformLibraryValidation(IProgress`1 progress, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.ValidateMediaLibraryInternal(IProgress`1 progress, CancellationToken cancellationToken)
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)

@PenkethBoy: Thank you, I appreciate your hint. A USP is already on my "should do" list but the last power outage here was 4 years ago and for an 8 bay NAS + media server with an i5 I will probably need a rather large one, so I never really put that plan into reality. But perhaps I should re-prioritize.

Cheers

NicoLaz

Link to comment
Share on other sites

Gilgamesh_48
28 minutes ago, NicoLaz said:

A USP is already on my "should do" list but the last power outage here was 4 years ago and for an 8 bay NAS + media server with an i5 I will probably need a rather large one, so I never really put that plan into reality. But perhaps I should re-prioritize.

I assume that was a typo and you meant UPS.

I have a few of these:
https://www.amazon.com/gp/product/B000FBK3QK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
and just one holds up two servers, a router, 15 or so external hard drives and a few other small devices plenty long enough to allow and orderly shutdown and it easily prevents any reboots or glitches resulting from momentary power losses. I believe there may be better or cheaper ones currently available BUT be careful when trying to save money. Power protection is not the place to try and save money at the expense of quality.

A good UPS, or several if needed, are a small investment toward preventing the problems that losses of power or power glitches can cause. Surge protectors are almost useless in the real world for meaningful protection. They are better than nothing but by only a small margin.

Link to comment
Share on other sites

On 9/27/2020 at 9:02 AM, NicoLaz said:

Hi @Luke

Thank you for your fast reply! I wanted to prepare the logs this morning but noticed that they already went into rotation and got deleted :( I didn't realize the timespan was so short, sorry... The only thing I still habe is those two warning messages in the message history - they belong to the two libraries I was missing:


Could not find a part of the path 'C:\Users\cube\AppData\Roaming\Emby-Server\programdata\root\default\Recorded Movies11'.
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
at System.IO.Enumeration.FileSystemEnumerableFactory.FileSystemInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileSystemEntries(String path, Boolean recursive)
at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntries(String path)
at MediaBrowser.Controller.IO.FileData.GetFilteredFileSystemEntries(IDirectoryService directoryService, String path, IFileSystem fileSystem, IServerApplicationHost appHost, ILogger logger, ItemResolveArgs args, Int32 flattenFolderDepth, Boolean resolveShortcuts)
at MediaBrowser.Controller.Entities.CollectionFolder.CreateResolveArgs(IDirectoryService directoryService)
at MediaBrowser.Controller.Entities.CollectionFolder.FolderIdsRequireUpdating(Boolean updateValues)
at MediaBrowser.Controller.Entities.CollectionFolder.BeforeMetadataRefresh(Boolean replaceAllMetdata)
at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.ValidateTopLibraryFolders(Boolean refreshMetadatas, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.PerformLibraryValidation(IProgress`1 progress, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.ValidateMediaLibraryInternal(IProgress`1 progress, CancellationToken cancellationToken)
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)

Could not find a part of the path 'C:\Users\cube\AppData\Roaming\Emby-Server\programdata\root\default\Recordings1'.
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
at System.IO.Enumeration.FileSystemEnumerableFactory.FileSystemInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileSystemEntries(String path, Boolean recursive)
at MediaBrowser.Controller.Providers.DirectoryService.GetFileSystemEntries(String path)
at MediaBrowser.Controller.IO.FileData.GetFilteredFileSystemEntries(IDirectoryService directoryService, String path, IFileSystem fileSystem, IServerApplicationHost appHost, ILogger logger, ItemResolveArgs args, Int32 flattenFolderDepth, Boolean resolveShortcuts)
at MediaBrowser.Controller.Entities.CollectionFolder.CreateResolveArgs(IDirectoryService directoryService)
at MediaBrowser.Controller.Entities.CollectionFolder.FolderIdsRequireUpdating(Boolean updateValues)
at MediaBrowser.Controller.Entities.CollectionFolder.RequiresRefresh()
at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.ValidateTopLibraryFolders(Boolean refreshMetadatas, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.PerformLibraryValidation(IProgress`1 progress, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.ValidateMediaLibraryInternal(IProgress`1 progress, CancellationToken cancellationToken)
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)

@PenkethBoy: Thank you, I appreciate your hint. A USP is already on my "should do" list but the last power outage here was 4 years ago and for an 8 bay NAS + media server with an i5 I will probably need a rather large one, so I never really put that plan into reality. But perhaps I should re-prioritize.

Cheers

NicoLaz

Ok if you see it again and you have the emby server log, please attach it. Thanks !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...