jellyfin / jellyfin-plugin-nextpvr

https://jellyfin.org
MIT License
25 stars 9 forks source link

Server crashing after installation #20

Closed jakobkukla closed 2 years ago

jakobkukla commented 3 years ago

This plugin is crashing my server randomly. I'm using Jellyfin 10.7.0 (git master).

System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Jellyfin.Plugin.NextPVR.RecordingsChannel.GetService()
   at Jellyfin.Plugin.NextPVR.RecordingsChannel.GetCacheKey(String userId)
   at Emby.Server.Implementations.Channels.ChannelManager.GetChannelDataCachePath(IChannel channel, String userId, String externalFolderId, Nullable`1 sortField, Boolean sortDescending)
   at Emby.Server.Implementations.Channels.ChannelManager.GetChannelItems(IChannel channel, User user, String externalFolderId, Nullable`1 sortField, Boolean sortDescending, CancellationToken cancellationToken)
   at Emby.Server.Implementations.Channels.ChannelManager.GetChannelItemsInternal(InternalItemsQuery query, IProgress`1 progress, CancellationToken cancellationToken)
   at Emby.Server.Implementations.Channels.ChannelManager.RefreshLatestChannelItems(IChannel channel, CancellationToken cancellationToken)
   at Emby.Server.Implementations.Channels.ChannelManager.GetLatestChannelItemsInternal(InternalItemsQuery query, CancellationToken cancellationToken)
   at Emby.Server.Implementations.Library.UserViewManager.GetItemsForLatestItems(User user, LatestItemsQuery request, DtoOptions options)
   at Emby.Server.Implementations.Library.UserViewManager.GetLatestItems(LatestItemsQuery request, DtoOptions options)
   at Jellyfin.Api.Controllers.UserLibraryController.GetLatestMedia(Guid userId, Nullable`1 parentId, ItemFields[] fields, BaseItemKind[] includeItemTypes, Nullable`1 isPlayed, Nullable`1 enableImages, Nullable`1 imageTypeLimit, ImageType[] enableImageTypes, Nullable`1 enableUserData, Int32 limit, Boolean groupItems)
   at lambda_method899(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|24_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.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, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   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.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
[19:36:20] [ERR] [26] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL GET /Items/76cccb8318c0b9f81429dd93ef7fb856/Images/Primary.
System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at Emby.Server.Implementations.Library.LibraryManager.ConvertImageToLocal(BaseItem item, ItemImageInfo image, Int32 imageIndex)
   at Jellyfin.Api.Controllers.ImageController.GetImageResult(BaseItem item, Guid itemId, Nullable`1 index, Nullable`1 height, Nullable`1 maxHeight, Nullable`1 maxWidth, Nullable`1 quality, Nullable`1 width, Nullable`1 addPlayedIndicator, Nullable`1 percentPlayed, Nullable`1 unplayedCount, Nullable`1 blur, String backgroundColor, String foregroundLayer, ItemImageInfo imageInfo, Boolean cropWhitespace, IReadOnlyCollection`1 supportedFormats, Nullable`1 cacheDuration, IDictionary`2 headers, Boolean isHeadRequest)
   at Jellyfin.Api.Controllers.ImageController.GetImageInternal(Guid itemId, ImageType imageType, Nullable`1 imageIndex, String tag, Nullable`1 format, Nullable`1 maxWidth, Nullable`1 maxHeight, Nullable`1 percentPlayed, Nullable`1 unplayedCount, Nullable`1 width, Nullable`1 height, Nullable`1 quality, Nullable`1 cropWhitespace, Nullable`1 addPlayedIndicator, Nullable`1 blur, String backgroundColor, String foregroundLayer, BaseItem item, Boolean isHeadRequest, ItemImageInfo imageInfo)
   at Jellyfin.Api.Controllers.ImageController.GetItemImage(Guid itemId, ImageType imageType, Nullable`1 maxWidth, Nullable`1 maxHeight, Nullable`1 width, Nullable`1 height, Nullable`1 quality, String tag, Nullable`1 cropWhitespace, Nullable`1 format, Nullable`1 addPlayedIndicator, Nullable`1 percentPlayed, Nullable`1 unplayedCount, Nullable`1 blur, String backgroundColor, String foregroundLayer, Nullable`1 imageIndex)
   at lambda_method878(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   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>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_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>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   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, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   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.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
[19:36:20] [WRN] [26] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from https://jellyfin.jakobkukla.xyz/Items/76cccb8318c0b9f81429dd93ef7fb856/Images/Primary?maxWidth=470&tag=b8e4407f0953549fff2da1ba53d577a3&quality=90 to 192.168.8.100 in 0:00:00.5078753 with Status Code 500
[19:36:22] [WRN] [30] Jellyfin.Networking.Manager.NetworkManager: 192.168.8.100/32: GetBindInterface: Loopback 127.0.0.1 returned.
[19:36:22] [FTL] [27] Main: Unhandled Exception
System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Jellyfin.Plugin.NextPVR.RecordingsChannel.GetService()
   at Jellyfin.Plugin.NextPVR.RecordingsChannel.OnUpdateTimerCallbackAsync(Object state)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
   at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
Unhandled exception. System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Jellyfin.Plugin.NextPVR.RecordingsChannel.GetService()
   at Jellyfin.Plugin.NextPVR.RecordingsChannel.OnUpdateTimerCallbackAsync(Object state)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
   at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
emveepee commented 3 years ago

Report problems on the NextPVR forum and include the zipped logs from NextPVR and full logs from Jellyfin, no snippets.

crobibero commented 2 years ago

I’ve fixed the issue for plugin v7