jellyfin / jellyfin-plugin-kodisyncqueue

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

Plugin status "Malfunctioned" #73

Closed ankorite closed 2 years ago

ankorite commented 2 years ago

I am on a Docker container running Jellyfin 10.9.0. KodiSyncQueue is on 9.0.0. I am seeing "Malfunctioned" in the plugin status and logs say this:

 Sync Requested for UserID: '436da6ef6eb344eea1eadcecd0235411' with LastUpdateDT: '2022-08-24T03:03:40z'
[03:30:36] [ERR] [24] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL GET /Jellyfin.Plugin.KodiSyncQueue/436da6ef6eb344eea1eadcecd0235411/GetItems.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Jellyfin.Plugin.KodiSyncQueue.API.KodiSyncQueueController.PopulateLibraryInfo(String userId, String lastRequestedDt, IReadOnlyCollection`1 filters)
   at Jellyfin.Plugin.KodiSyncQueue.API.KodiSyncQueueController.GetLibraryItemsQuery(String userId, String lastUpdateDt, String filter)
   at lambda_method787(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Jellyfin.Server.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
   at Jellyfin.Server.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
   at Jellyfin.Server.Middleware.IpBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
   at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
   at Jellyfin.Server.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
ankorite commented 2 years ago

I have tried uninstalling and reinstalling the plugin. Originally I was on Jellyfin 10.8.0 and had the same issue so I upgraded to see if that would help.

WybeBosch commented 2 years ago

Im having the same issue, except im getting a slightly different error. I seemed to have fixed my issue by manually deleting all info related to kodi sync queue from the folders (a couple sql databases, and the config file) And then reinstalled using the interface. (Just as my detailed error said something about sql and duplicate ID, that probaby was it. ) (not quite sure why sql databases are left behind on uninstall via jellyfin interface)

While both our interface errors says malfunctioned, i think my problem is different than yours :(

============== OLD INFO ==================== Im currently on Jellyfin Stable Version: 10.8.4 (on Windows, using the Install exe.) I have tried installing the plugin manually, then i tried uninstalling via the Jellyfin interface, rebooting and installing it via the Jellyfin interface. Then i tried uninstalling that, rebooting, and installing an Older version via the interface 8.0.0.0 and that seemed to work for a sec, but when i rebooted it had reinstalled 9.0.0.0 again, and was stuck on malfunctioned (as if it auto upgraded the plugin version)

Jellyfin interface says : Kodi Sync Queue9.0.0.0 Status: Malfunctioned

[2022-09-23 12:30:13.405 +02:00] [INF] [1] Jellyfin.Plugin.KodiSyncQueue.KodiSyncQueuePlugin: KodiSyncQueue is starting...
[2022-09-23 12:30:13.406 +02:00] [INF] [1] Jellyfin.Plugin.KodiSyncQueue.Data.DbRepo: Creating DB Repository...
[2022-09-23 12:30:13.929 +02:00] [ERR] [1] Emby.Server.Implementations.Plugins.PluginManager: Error creating "Jellyfin.Plugin.KodiSyncQueue.KodiSyncQueuePlugin"
LiteDB.LiteException: Cannot insert duplicate key in unique index '_id'. The duplicate value is '8369'.
   at LiteDB.Engine.IndexService.AddNode(CollectionIndex index, BsonValue key, PageAddress dataBlock, Byte level, IndexNode last)
   at LiteDB.Engine.IndexService.AddNode(CollectionIndex index, BsonValue key, PageAddress dataBlock, IndexNode last)
   at LiteDB.Engine.LiteEngine.InsertDocument(Snapshot snapshot, BsonDocument doc, BsonAutoId autoId, IndexService indexer, DataService data)
   at LiteDB.Engine.LiteEngine.RebuildContent(IFileReader reader)
   at LiteDB.Engine.LiteEngine.Upgrade(String filename, String password, Collation collation)
   at LiteDB.LiteDatabase..ctor(ConnectionString connectionString, BsonMapper mapper)
   at LiteDB.LiteDatabase..ctor(String connectionString, BsonMapper mapper)
   at Jellyfin.Plugin.KodiSyncQueue.Data.DbRepo..ctor(String dPath, ILogger`1 logger)
   at Jellyfin.Plugin.KodiSyncQueue.KodiSyncQueuePlugin..ctor(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, ILoggerFactory loggerFactory)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
   at Emby.Server.Implementations.Plugins.PluginManager.CreatePluginInstance(Type type)
[2022-09-23 12:30:13.942 +02:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Plugin "C:\ProgramData\Jellyfin\Server\plugins\Kodi Sync Queue_9.0.0.0" has been disabled.
[2022-09-23 12:30:13.944 +02:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "TMDb Box Sets" "10.0.0.0"
[2022-09-23 12:30:13.946 +02:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "Trakt" "20.0.0.0"
[2022-09-23 12:30:13.947 +02:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "TMDb" "10.8.4.0"
[2022-09-23 12:30:13.948 +02:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "Studio Images" "10.8.4.0"
[2022-09-23 12:30:13.949 +02:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "OMDb" "10.8.4.0"
[2022-09-23 12:30:13.950 +02:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "MusicBrainz" "10.8.4.0"
[2022-09-23 12:30:13.951 +02:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "AudioDB" "10.8.4.0"
ankorite commented 2 years ago

I think it is 100% the same issue. You are on Windows I take it? I am on Linux. I shelled into my container and removed the DBs pertaining to KodiSyncQuque and the xml config (previously only tried removing the new DB not all of them) So far so good.

I think the issue is from migrating from 8 to 9 it messes up the LiteDB somehow.

I will close this if there it doesn't fail in a day or so.