jellyfin / jellyfin-plugin-kodisyncqueue

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

Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger' while attempting to activate 'Jellyfin.Plugin.KodiSyncQueue.API.ServerTimeAPI'. #27

Closed marcogaio closed 4 years ago

marcogaio commented 4 years ago

Every time i launch Kodi, this error thrown out on jellyfin server:

Aug  5 14:43:53 vmedialpb jellyfin[1231]: [14:43:53] [ERR] Error processing request. URL: http://192.168.1.8:8096//Jellyfin.Plugin.KodiSyncQueue/GetServerDateTime
Aug  5 14:43:53 vmedialpb jellyfin[1231]: System.InvalidOperationException: Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger' while attempting to activate 'Jellyfin.Plugin.KodiSyncQueue.API.ServerTimeAPI'.
Aug  5 14:43:53 vmedialpb jellyfin[1231]:    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
Aug  5 14:43:53 vmedialpb jellyfin[1231]:    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
Aug  5 14:43:53 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost httpHost, Object requestDto, IRequest req)
Aug  5 14:43:53 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost httpHost, IRequest httpReq, HttpResponse httpRes, ILogger logger, CancellationToken cancellationToken)
Aug  5 14:43:53 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)
Aug  5 14:43:53 vmedialpb jellyfin[1231]: [14:43:53] [ERR] Error processing request. URL: http://192.168.1.8:8096/Jellyfin.Plugin.KodiSyncQueue/df17c07b617345098e0390183498c8a4/GetItems?filter=music%2Cmusicvideos&LastUpdateDT=2020-07-19T16%3A48%3A59z
Aug  5 14:43:53 vmedialpb jellyfin[1231]: System.InvalidOperationException: Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger' while attempting to activate 'Jellyfin.Plugin.KodiSyncQueue.API.SyncAPI'.
Aug  5 14:43:53 vmedialpb jellyfin[1231]:    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
Aug  5 14:43:53 vmedialpb jellyfin[1231]:    at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
Aug  5 14:43:53 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost httpHost, Object requestDto, IRequest req)
Aug  5 14:43:53 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost httpHost, IRequest httpReq, HttpResponse httpRes, ILogger logger, CancellationToken cancellationToken)
Aug  5 14:43:53 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)
Aug  5 14:50:27 vmedialpb jellyfin[1231]: [14:50:27] [ERR] Error processing request. URL: http://192.168.1.8:8096/Users/df17c07b617345098e0390183498c8a4/Items/b9c4372d9c847f740abab721034a7d70
Aug  5 14:50:27 vmedialpb jellyfin[1231]: System.NullReferenceException: Object reference not set to an instance of an object.
Aug  5 14:50:27 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.Dto.DtoService.GetBaseItemDtoInternal(BaseItem item, DtoOptions options, User user, BaseItem owner)
Aug  5 14:50:27 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.Dto.DtoService.GetBaseItemDto(BaseItem item, DtoOptions options, User user, BaseItem owner)
Aug  5 14:50:27 vmedialpb jellyfin[1231]:    at MediaBrowser.Api.UserLibrary.UserLibraryService.Get(GetItem request)
Aug  5 14:50:27 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.Services.ServiceExecGeneral.GetTaskResult(Task task)
Aug  5 14:50:27 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost httpHost, IRequest httpReq, HttpResponse httpRes, ILogger logger, CancellationToken cancellationToken)
Aug  5 14:50:27 vmedialpb jellyfin[1231]:    at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)

Kodi at every startup print a warning saying it was not able to update jellyfin matherial.

Error started after some recent Jellyfin update.

Googling around, seems me that the trouble came from an API change in C#, that need to cleanup.

mcarlton00 commented 4 years ago

Just for clarity, did you have Kodi Sync Queue installed in a previous version of Jellyfin and when you updated to 10.6.x it became uninstalled and started throwing these errors?

When updating from 10.5.x to 10.6.x, it seems as though the plugin got disabled and needs to be reinstalled. It's possible that the old dll was still lingering on disk and failing to load repeatedly, especially if your server is running on Windows. More Kodi specific discussion of this happened here

marcogaio commented 4 years ago

Now i'm on vacation, and i've got no time to add some comment to this bug but... yes, after some days from the bug report, i've noted that some plugin (at leask KODI sync queue and email) get disbled/uninstalled.

I've re-enabled/reinstalled the plugin, and now error gone away.

But i've found that now Jellifin seems was not able anymore to scan my libraries, stop at 96%. Probably this is another bug, so, feel fine to close this and excuse me.

Thanks.