jellyfin / jellyfin-plugin-kodisyncqueue

https://jellyfin.org
GNU General Public License v2.0
44 stars 13 forks source link

Library sync failing, with "Error Has Occurred in LibraryUpdateTimerCallback - System.InvalidCastException: Unable to cast object of type 'LiteDB.EmptyPage' to type 'LiteDB.HeaderPage'" #13

Closed r0bbie closed 3 years ago

r0bbie commented 5 years ago

Running latest Jellyfin 10.3.7, and Jellyfin Kodi plugin version 0.2.1.

Syncing updates from my Jellyfin library to Kodi has recently started failing. On Kodi side get an "Failed to retrieve latest content updates" error.

Checking the corresponding Jellyfin logs to catch the failing sync:


[2019-08-25 01:00:33.231 +01:00] [INF] "LIBRARYSYNC" Added 0 items:  ""
[2019-08-25 01:00:33.232 +01:00] [ERR] An Error Has Occurred in LibraryUpdateTimerCallback
System.InvalidCastException: Unable to cast object of type 'LiteDB.EmptyPage' to type 'LiteDB.HeaderPage'.
   at LiteDB.PageService.GetPage[T](UInt32 pageID)
   at LiteDB.CollectionService.Get(String name)
   at LiteDB.LiteEngine.GetCollectionPage(String name, Boolean addIfNotExits)
   at LiteDB.LiteEngine.Find(String collection, Query query, Int32 skip, Int32 limit)+MoveNext()
   at LiteDB.LiteEngine.Find(String collection, Query query, String[] includes, Int32 skip, Int32 limit)+MoveNext()
   at LiteDB.LiteCollection`1.Find(Query query, Int32 skip, Int32 limit)+MoveNext()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at Jellyfin.Plugin.KodiSyncQueue.Data.DbRepo.WriteLibrarySync(IEnumerable`1 items, ItemStatus status, CancellationToken cancellationToken)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification.UpdateLibrary(IReadOnlyCollection`1 items, ItemStatus status, CancellationToken cancellationToken)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification.PushChangesToDb(IReadOnlyCollection`1 itemsAdded, IReadOnlyCollection`1 itemsUpdated, IReadOnlyCollection`1 itemsRemoved, CancellationToken cancellationToken)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification.LibraryUpdateTimerCallback(Object state)```
r0bbie commented 4 years ago

Reset my local library and started fresh which seemed to resolve this issue for a while, but it's now recurred. Can't get my Kodi library to sync with Jellyfin at all.. seriously frustrating.

r0bbie commented 4 years ago

I'm currently having to reset my Jellyfin library on Kodi around once a week or so whenever this error appears again, or syncing will fail indefinitely. Which takes an aaaage every time I have to do a reset and entire library re-import.

Any assistance on this at all would be hugely appreciated!

oddstr13 commented 3 years ago

Are you still seeing this issue with the current version of the plugin?

r0bbie commented 3 years ago

At least for the time being this seems to have resolved itself. It was happening just about every week for a long time, but not had it reoccur for a few months now.

A few months ago I did do a fresh install of Jellyfin on Ubuntu (having been hosting on a CentOS server previously) and it may have corresponded with that, but may also just have been a coincidence.

Never determined the cause of the "Unable to cast object of type 'LiteDB.EmptyPage' to type 'LiteDB.HeaderPage'" error

oddstr13 commented 3 years ago

Great, thanks! Don't hesitate to reopen or comment with more details if you do encounter the issue again.

I apologize for not responding initially, but plugins are mostly ignored between releases :sweat_smile: