Jellyfin Forum
SOLVED: 10.9.2 Failing Library Scan - 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: 10.9.2 Failing Library Scan (/t-solved-10-9-2-failing-library-scan)



10.9.2 Failing Library Scan - gccalvin - 2024-05-18

Hello,

My server is running on a Debian 11 bullseye virtual machine, installed via the apt repository.

I upgraded from 10.9.1 to 10.9.2 and now my library scans are failing:

Code:
[2024-05-17 22:01:09.154 -05:00] [ERR] Error in "Probe Provider"
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 6: 'database table is locked'.
  at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
  at Microsoft.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText, SqliteParameter[] parameters)
  at Microsoft.Data.Sqlite.SqliteTransaction..ctor(SqliteConnection connection, IsolationLevel isolationLevel, Boolean deferred)
  at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel, Boolean deferred)
  at Emby.Server.Implementations.Data.SqliteItemRepository.SaveMediaStreams(Guid id, IReadOnlyList`1 streams, CancellationToken cancellationToken)
  at MediaBrowser.Providers.MediaInfo.AudioFileProber.FetchAsync(Audio audio, MediaInfo mediaInfo, MetadataRefreshOptions options, CancellationToken cancellationToken)
  at MediaBrowser.Providers.MediaInfo.AudioFileProber.Probe[T](T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
  at MediaBrowser.Providers.Manager.MetadataService`2.RunCustomProvider(ICustomMetadataProvider`1 provider, TItemType item, String logName, MetadataRefreshOptions options, RefreshResult refreshResult, CancellationToken cancellationToken)

In the log (attached), you can see the "ERR" for me stopping the trickplay generation, that is before I shutdown (through the Jellyfin Shutdown button) the server and updated (through apt-get upgrade).

Things I've tried:
- Rollback to 10.9.1 and try the upgrade again
- Reboot the VM
- Restart the Jellyfin server
- Disable the music library (which the ui won't let me re-enable, I may need to create another post on that if I can't fix it)

This may not be related, but ever since upgrading to 10.9.0 + my library scans have been taking longer. They were previously about 2 minutes, and now they are 12-15, with minimal to no usage on the server. The scan sits around 92% for a while before it finishes. In this instance, the scan makes it to around 92% but fails. I don't know if the long scans on 10.9.0 / 10.9.1 is due to the back-end changes, or maybe my database is failing / corrupt, and now I can't scan the library fully. Oddly enough, the scan fails at the 2 minute mark. Additionally, I was able to add a song and a video to one of my libraries, and the scan picked it up, even though it failed.

Any help is appreciated, thank you.


RE: 10.9.2 Failing Library Scan - TheDreadPirate - 2024-05-18

Two things I am seeing. First, it looks like your NFS share unmounted or was otherwise unavailable

Code:
[2024-05-17 21:59:50.206 -05:00] [WRN] Library folder "/nfs/media/4k_Shows/Anime" is inaccessible or empty, skipping
[2024-05-17 21:59:50.264 -05:00] [WRN] Library folder "/nfs/media/4k_Shows/Anime" is inaccessible or empty, skipping

Two, if I had to guess maybe you ran out of space on your partition where your jellyfin data is located?

Code:
[2024-05-17 22:00:45.571 -05:00] [ERR] Error in "AniDB"
System.Xml.XmlException: Root element is missing.



RE: 10.9.2 Failing Library Scan - gccalvin - 2024-05-19

(2024-05-18, 04:27 AM)TheDreadPirate Wrote: Two things I am seeing.  First, it looks like your NFS share unmounted or was otherwise unavailable

Code:
[2024-05-17 21:59:50.206 -05:00] [WRN] Library folder "/nfs/media/4k_Shows/Anime" is inaccessible or empty, skipping
[2024-05-17 21:59:50.264 -05:00] [WRN] Library folder "/nfs/media/4k_Shows/Anime" is inaccessible or empty, skipping

Two, if I had to guess maybe you ran out of space on your partition where your jellyfin data is located?

Code:
[2024-05-17 22:00:45.571 -05:00] [ERR] Error in "AniDB"
System.Xml.XmlException: Root element is missing.

Hello,

Thank you for your patience. To answer your questions, no, there is plenty of space on the partition and the NAS where the media is stored. Additionally, I can access the mount with no issues.

However, I decided to reboot the NAS, (and the vm after it booted). The problem persisted, so I disabled AniDB manually on all of my libraries and the issue went away. I then scanned each library while enabling AniDB in the library settings.

Even now, after AniDB is enabled on all the libraries, a full library scan doesn't fail, and the AniDB error's I was getting before are gone. I still think the reboot of the NAS, fixed this, but I'm not sure.

Over the past day, I've been unable to reproduce the issue, and there are no [ERR]s in the logs now.

Thank you for your help. You may consider this issue closed for now.


RE: 10.9.2 Failing Library Scan - tbyt2000 - 2024-05-23

Hi. I have the same problem.
Moved from 10.8.13 to 10.9.1 - accidentally. I was refershing my docker image and hadn't seen the release announcement. Unfortunately this means I don't have a backup. I took lots of test backups for the 10.9 test versions but had cleared them down before the accidental upgrade. Embarassing.
My database is on an SSD and I have 50GB spare on that drive (my library has ballooned to 117GB after the upgrade).
I since upgraded to 10.9.2 before I realised I had a library issue.

Code:
[2024-05-23 09:26:42.254 +01:00] [ERR] [167] Emby.Server.Implementations.ScheduledTasks.TaskManager: Error executing Scheduled Task
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 6: 'database table is locked'.
  at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
  at Microsoft.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText, SqliteParameter[] parameters)
  at Microsoft.Data.Sqlite.SqliteTransaction..ctor(SqliteConnection connection, IsolationLevel isolationLevel, Boolean deferred)
  at Emby.Server.Implementations.Data.SqliteItemRepository.SaveImages(BaseItem item)
  at Emby.Server.Implementations.Library.LibraryManager.UpdateImagesAsync(BaseItem item, Boolean forceUpdate)
  at Emby.Server.Implementations.Library.LibraryManager.RunMetadataSavers(BaseItem item, ItemUpdateType updateReason)
  at Emby.Server.Implementations.Library.LibraryManager.UpdateItemsAsync(IReadOnlyList`1 items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken)
  at MediaBrowser.Providers.Manager.MetadataService`2.SaveItemAsync(MetadataResult`1 result, ItemUpdateType reason, CancellationToken cancellationToken)
  at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
  at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)
  at MediaBrowser.Controller.Entities.Folder.RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken)
  at MediaBrowser.Controller.Entities.Folder.<>c__DisplayClass69_0`1.<<RunTasks>b__1>d.MoveNext()
--- End of stack trace from previous location ---
  at MediaBrowser.Controller.Entities.Folder.RunTasks[T](Func`3 task, IList`1 children, IProgress`1 progress, CancellationToken cancellationToken)
  at MediaBrowser.Controller.Entities.Folder.RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken)
  at MediaBrowser.Controller.Entities.Folder.<>c__DisplayClass69_0`1.<<RunTasks>b__1>d.MoveNext()
--- End of stack trace from previous location ---
  at MediaBrowser.Controller.Entities.Folder.RunTasks[T](Func`3 task, IList`1 children, IProgress`1 progress, CancellationToken cancellationToken)
  at MediaBrowser.Controller.Entities.Folder.RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken)
  at MediaBrowser.Controller.Entities.Folder.<>c__DisplayClass69_0`1.<<RunTasks>b__1>d.MoveNext()
--- End of stack trace from previous location ---
  at MediaBrowser.Controller.Entities.Folder.RunTasks[T](Func`3 task, IList`1 children, IProgress`1 progress, CancellationToken cancellationToken)
  at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal2(IProgress`1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken)
  at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal(IProgress`1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken)
  at MediaBrowser.Controller.Entities.AggregateFolder.ValidateChildrenInternal(IProgress`1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, 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)
[2024-05-23 09:26:42.255 +01:00] [INF] [167] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Scan Media Library" Failed after 4 minute(s) and 5 seconds

As I don't have a 10.8 backup I am pretty knackered. Any help in resolving would be very much appreciated.
Thanks Jellyfin friends!


RE: 10.9.2 Failing Library Scan - Fate - 2024-05-23

that is weird. My libary.db is around 520MB and my jellyfin.db around 0,4mb.  (Around 20TB of Data in the Libary)

Which file got so big?
as for unlocking your database. Either a reboot or copying the database and copy it back to original place should "unlock" it. Since it's only an Sqlite it doesn't really get locked internally, it gets just locked by a process accessing it.


RE: 10.9.2 Failing Library Scan - tbyt2000 - 2024-05-23

Hi Fate. Thanks for your response.
My library.db is over 800MB. The meteadta folder is the size problem - approx 112GB. My library is very big Smiling-face
I have temprorarily fixed the SQL locking by setting the Parallel library scan tasks limit (In General settings) to 1.
I think simultaneous library scans (which is now the default behaviour) are locking each other out. There is a bug logged for this (which is where I found the workaround).
My Jellyfin is back up and running Smiling-face


RE: 10.9.2 Failing Library Scan - Fate - 2024-05-23

So if it's all metadata then probably you have trackplay and chapter picture enabled in your library settings?

My guess is trickplay is the issue, that would explain also why your libary scans take so long they lock each other.