jellyfin / jellyfin-plugin-kodisyncqueue

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

Cannot access a disposed object in LibraryUpdateTimerCallback and UserUpdateTimerCallback #84

Open oddstr13 opened 6 months ago

oddstr13 commented 6 months ago
          Also getting this after upgrading 10.9.1, error in LibraryUpdateTimerCallback, maybe related ?

Running in docker on debian

[2024-05-14 09:53:56.946 +02:00] [ERR] [89] Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification: An error has occurred in LibraryUpdateTimerCallback
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.ReaderWriterLockSlim'.
   at System.Threading.ReaderWriterLockSlim.TryEnterReadLockCore(TimeoutTracker timeout)
   at LiteDB.Engine.LockService.EnterTransaction()
   at LiteDB.Engine.TransactionMonitor.GetTransaction(Boolean create, Boolean queryOnly, Boolean& isNew)
   at LiteDB.Engine.QueryExecutor.ExecuteQuery(Boolean executionPlan)
   at LiteDB.Engine.LiteEngine.Query(String collection, Query query)
   at LiteDB.LiteQueryable`1.ToDocuments()+MoveNext()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at Jellyfin.Plugin.KodiSyncQueue.Data.DbRepo.WriteLibrarySync(IEnumerable`1 items, ItemStatus status)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification.UpdateLibrary(IReadOnlyCollection`1 items, ItemStatus status)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification.PushChangesToDb(IReadOnlyCollection`1 itemsAdded, IReadOnlyCollection`1 itemsUpdated, IReadOnlyCollection`1 itemsRemoved)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification.LibraryUpdateTimerCallback(Object state)

Also "UserUpdateTimerCallback"

[2024-05-14 09:53:31.905 +02:00] [INF] [98] Jellyfin.Plugin.KodiSyncQueue.EntryPoints.UserSyncNotification: Started user data sync
[2024-05-14 09:53:32.060 +02:00] [ERR] [98] Jellyfin.Plugin.KodiSyncQueue.EntryPoints.UserSyncNotification: An error has occurred in UserUpdateTimerCallback
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.ReaderWriterLockSlim'.
   at System.Threading.ReaderWriterLockSlim.TryEnterReadLockCore(TimeoutTracker timeout)
   at LiteDB.Engine.LockService.EnterTransaction()
   at LiteDB.Engine.TransactionMonitor.GetTransaction(Boolean create, Boolean queryOnly, Boolean& isNew)
   at LiteDB.Engine.QueryExecutor.ExecuteQuery(Boolean executionPlan)
   at LiteDB.Engine.LiteEngine.Query(String collection, Query query)
   at LiteDB.LiteQueryable`1.ToDocuments()+MoveNext()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at Jellyfin.Plugin.KodiSyncQueue.Data.DbRepo.<>c__DisplayClass10_0.<SetUserInfoSync>b__0(UserItemDataDto dto)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Jellyfin.Plugin.KodiSyncQueue.Data.DbRepo.SetUserInfoSync(List`1 dtos, List`1 itemRefs, String userId)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.UserSyncNotification.SaveUserChanges(List`1 dtos, List`1 itemRefs, String userName, String userId)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.UserSyncNotification.SendNotifications(IEnumerable`1 changes, List`1 itemRefs, CancellationToken cancellationToken)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.UserSyncNotification.UpdateTimerCallback(Object state)

Originally posted by @abbekeff in https://github.com/jellyfin/jellyfin-plugin-kodisyncqueue/issues/83#issuecomment-2109592747

oddstr13 commented 6 months ago

Reported by multiple people in issue #83 and the forum https://forum.jellyfin.org/t-error-in-kodiqueueplugin-after-update-to-10-9-1

oddstr13 commented 6 months ago
          Same thing here since the last 2 Jellyfin server updates:
[15:37:01] [ERR] [15] Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification: An error has occurred in LibraryUpdateTimerCallback
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.ReaderWriterLockSlim'.
   at System.Threading.ReaderWriterLockSlim.TryEnterReadLockCore(TimeoutTracker timeout)
   at LiteDB.Engine.LockService.EnterTransaction()
   at LiteDB.Engine.TransactionMonitor.GetTransaction(Boolean create, Boolean queryOnly, Boolean& isNew)
   at LiteDB.Engine.QueryExecutor.ExecuteQuery(Boolean executionPlan)
   at LiteDB.Engine.LiteEngine.Query(String collection, Query query)
   at LiteDB.LiteQueryable`1.ToDocuments()+MoveNext()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at Jellyfin.Plugin.KodiSyncQueue.Data.DbRepo.WriteLibrarySync(IEnumerable`1 items, ItemStatus status)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification.UpdateLibrary(IReadOnlyCollection`1 items, ItemStatus status)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification.PushChangesToDb(IReadOnlyCollection`1 itemsAdded, IReadOnlyCollection`1 itemsUpdated, IReadOnlyCollection`1 itemsRemoved)
   at Jellyfin.Plugin.KodiSyncQueue.EntryPoints.LibrarySyncNotification.LibraryUpdateTimerCallback(Object state)

Originally posted by @axionman in https://github.com/jellyfin/jellyfin-plugin-kodisyncqueue/issues/83#issuecomment-2110567719