LizardByte / Themerr-jellyfin

Plugin for Jellyfin that adds theme songs to movies and tv shows using ThemerrDB.
https://app.lizardbyte.dev/ThemerrDB
GNU Affero General Public License v3.0
91 stars 7 forks source link

Newtonsoft.Json.JsonReaderException: Additional text encountered after finished reading JSON content #321

Open John5798 opened 2 weeks ago

John5798 commented 2 weeks ago

Describe the Bug

When the plugin settings window is opened. it throws an error "Unexpected error occurred creating progress dashboard" and nothing else except the setting to change the update interval is shown.

Screenshot 2024-05-14 103121
[10:30:49] [INF] [15] Jellyfin.Plugin.Themerr.Api.ThemerrController: Server culture: en-US
[10:30:54] [ERR] [61] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL GET /Themerr/GetProgress.
Newtonsoft.Json.JsonReaderException: Additional text encountered after finished reading JSON content: }. Path '', line 1, position 167.
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Jellyfin.Plugin.Themerr.ThemerrManager.GetExistingThemerrDataValue(String key, String themerrDataPath)
   at Jellyfin.Plugin.Themerr.ThemerrManager.GetThemeProvider(BaseItem item)
   at Jellyfin.Plugin.Themerr.Api.ThemerrController.GetProgress()
   at lambda_method2175(Closure, Object, Object[])
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, 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 Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
   at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
   at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
   at Jellyfin.Api.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Api.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.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
   at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

Also, the update theme songs task fails midway.

https://pastebin.com/SLZE4qmG

I tried refreshing all metadata for my libraries and also tried completely removing the plugin and residues and reinstalling. None seemed to work or change the behavior of the plugin.

Expected Behavior

A progress and list of movie and show names should have been shown inplace of an error and the scheduled task should have passed without an error.

Additional Context

OS: Ubuntu Linux 24.04 Noble Numbat Jellyfin Installation: Official Docker 10.9.1 Kernel: 6.8.0-31-generic Plugin Version: 2024.514.151.24 Plugin Installation type: Repository

haloTT100 commented 2 weeks ago

Same thing is happening to me. The weird part is when I first installed the plugin and started the scan, it actually showed me the progress dashboard, but after some time it just broke.

ReenigneArcher commented 2 weeks ago

I have created #331 to try to improve the error handling, it won't solve the problem, but it may help me identify the cause. Can you run this build and provide new logs?

You can download from here, if logged in to GitHub: https://github.com/LizardByte/Themerr-jellyfin/actions/runs/9134783177/artifacts/1514802319

haloTT100 commented 2 weeks ago

Same Unexpected error occurred creating progress dashboard, and I'm not getting any error messages only the usual "[WRN] [21] Jellyfin.Plugin.Themerr.ThemerrManager: Missing from ThemerrDB: "Movie", contribute:"

ReenigneArcher commented 2 weeks ago

@haloTT100 in that case, the cause of your error is not the same. This issue is due to an invalid json read. Please open a separate issue with relevant logs from both jellyfin logs as well as browser logs.

John5798 commented 2 weeks ago

I have created #331 to try to improve the error handling, it won't solve the problem, but it may help me identify the cause. Can you run this build and provide new logs?

You can download from here, if logged in to GitHub: https://github.com/LizardByte/Themerr-jellyfin/actions/runs/9134783177/artifacts/1514802319

My server is down at the moment (CPU fans blown). I could test it by Thursday the coming week. Sorry for the inconvenience and thanks for your awesome project!