Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue]: [10.9.0] An unhandled exception was thrown by the application #11563

Closed
1 task done
VampiricAlien opened this issue May 12, 2024 · 25 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@VampiricAlien
Copy link

VampiricAlien commented May 12, 2024

Please describe your bug

I am not sure, it was in the log after the sever slowed down.

Reproduction Steps

I am not sure.

Jellyfin Version

10.9.0

if other:

No response

Environment

- OS:ubuntu
- Linux Kernel: N/A
- Virtualization: no
- Clients: ATV
- Browser: N/A
- FFmpeg Version: 6.0
- Playback Method: ATV
- Hardware Acceleration: VAAPI
- GPU Model:none
- Plugins: Skip intro + Jellyfin plugins
- Reverse Proxy: no
- Base URL: N.A
- Networking: local
- Storage: local

Jellyfin logs

[ERR] Connection id "" "", Request id "" "": An unhandled exception was thrown by the application.
System.InvalidOperationException: Response Content-Length mismatch: too many bytes written (6533602 of 6533316).
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.WritePipeAsync(ReadOnlyMemory`1 data, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionBody.WriteAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Http.StreamCopyOperationInternal.CopyToAsync(Stream source, Stream destination, Nullable`1 count, Int32 bufferSize, CancellationToken cancel)
   at Microsoft.AspNetCore.Internal.FileResultHelper.WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue range, Int64 rangeLength)
   at Microsoft.AspNetCore.Mvc.Infrastructure.FileResultExecutorBase.WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue range, Int64 rangeLength)
   at Microsoft.AspNetCore.Mvc.Infrastructure.FileStreamResultExecutor.ExecuteAsync(ActionContext context, FileStreamResult result)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultFilters>g__Awaited|28_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   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>g__Awaited|20_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.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)
   at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
   at Jellyfin.Api.Middleware.BaseUrlRedirectionMiddleware.Invoke(HttpContext httpContext, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@VampiricAlien VampiricAlien added the bug Something isn't working label May 12, 2024
@jellyfin-bot
Copy link
Contributor

Hi, it seems like your issue report has the following item(s) that need to be addressed:

  • You have not filled in the environment completely.

This is an automated message, currently under testing. Please file an issue here if you encounter any problems.

@David-Moreira
Copy link

David-Moreira commented May 12, 2024

I've just updated to 10.9 and I also noticed jellyfin started crashing when playing a video sometime after, it could be 10m it could be 30m really couldn't tell exactly, so I also can't tell what might trigger it. By checking the logs I've seen a similar error with content mismatch. Since I personally don't have alot of time to troubleshoot I reverted back to a backup in v10.8.13

But I'd like if we can keep an eye on this and figuring out what triggers this behaviour.

@VampiricAlien
Copy link
Author

@David-Moreira I have skip intro scanning and I belive this is causing thh ATV client to crash randomly. I've asked Niels about this and he says "The app crashed because your server is not responding," the app being Android TV app. Before the update this never happened. I did notice the API endpoint was updated that plugins use, maybe https://github.com/jumoog/intro-skipper is slowing down jellyfin. I have checked the server and it's fine. Jellyfin seems overloaded?

@David-Moreira
Copy link

David-Moreira commented May 12, 2024

I see. I can confirm that I am also using the same intro-skipper plugin.

"The app crashed because your server is not responding,"

Edit: Yes that's the behaviour I had. Whatever jellyfin client is playing stops playing (but does not crash), and the server becomes completely unresponsive until restarted.

@VampiricAlien
Copy link
Author

Everything was fine until I told it to scan but is the issue jellyfin or the plugin and is this issue anything to do with the server becoming completely unresponsive?

@gnattu
Copy link
Member

gnattu commented May 12, 2024

If you are having issues with scanning causing the server to hang, can you try reduce the scan concurrency to a conservative value like 1? It is located in the Dashboard -> General the performance section. The default concurrency value could be too high for your disk and causing all kinds of IO hang.

@jumoog
Copy link

jumoog commented May 12, 2024

Please try scanning without the plugin

@David-Moreira
Copy link

Everything was fine until I told it to scan but is the issue jellyfin or the plugin and is this issue anything to do with the server becoming completely unresponsive?

Oh in my case even though I do have the same plugin intro-skipper plugin it was not scanning, as I only scan on "off-hours".
I had this behaviour at least 3 times before going ahead and just reverting back to my backup since I don't have time to troubleshoot today.
So I wouldn't be so sure it's an issue with the scanning?

@jumoog
Copy link

jumoog commented May 12, 2024

Scanning works fine. I notice that it removes old TV series from the DB that no longer exist. But after scanning everything went fine. Overall very high IO.

@VampiricAlien
Copy link
Author

@gnattu There was no number set,

Parallel library scan tasks limit is now 4
Parallel image encoding limit is now 2

@David-Moreira that to me says it might not be the plugin.

@jumoog
Copy link

jumoog commented May 12, 2024

Whats your ulimit?

@gnattu
Copy link
Member

gnattu commented May 12, 2024

@gnattu There was no number set,

Parallel library scan tasks limit is now 4 Parallel image encoding limit is now 2

@David-Moreira that to me says it might not be the plugin.

No number set = 2* logical cpu count, a very high concurrency

@VampiricAlien
Copy link
Author

@gnattu Would be a good idea in the text field to mention CPU count.

@David-Moreira
Copy link

@VampiricAlien are you able to reproduce the issue though? In order to properly test these settings you're changing?

@gnattu
Copy link
Member

gnattu commented May 12, 2024

@gnattu Would be a good idea in the text field to mention CPU count.

We plan to reduce the concurrency to a more conservative number in the future because this default value is too high for most of the underlying disks.

@VampiricAlien
Copy link
Author

VampiricAlien commented May 12, 2024

@David-Moreira
I have set it to 2 and is playing fine atm , I will set it to 1 since 2 didn't work. Iit's Monday morning for me.

@VampiricAlien
Copy link
Author

After setting it to 1, nothing was able to connect for about 10 minutes or so. I have removed the value.

@VampiricAlien
Copy link
Author

VampiricAlien commented May 13, 2024

https://github.com/jellyfin/jellyfin/releases/tag/v10.9.1 New update for 10.9. Will install this now.

@gnattu After 10.9.1 update Parallel library scan tasks limit was still set at 0, now set at 2
(Default to processor count concurrent scan instead of 2 * processor count)

@Raul824
Copy link

Raul824 commented May 13, 2024

could anyone tell me how is the intro skipper working in jellyfin 10.9.
I tried uninstalling and reinstalling from the fork of Bobby306 but it always says Not Supported post installation.

@VampiricAlien
Copy link
Author

could anyone tell me how is the intro skipper working in jellyfin 10.9. I tried uninstalling and reinstalling from the fork of Bobby306 but it always says Not Supported post installation.

You'll need to install https://github.com/jumoog/intro-skipper for it to work

@David-Moreira
Copy link

@VampiricAlien how's it been with 10.9.1?

@VampiricAlien
Copy link
Author

@David-Moreira Same as 10.9.0

@David-Moreira
Copy link

@VampiricAlien have you tried 10.9.2?

@VampiricAlien
Copy link
Author

@David-Moreira Yes, Fixed the crashing of the server and also fixes the websocks that causes skip into not to work.

@VampiricAlien
Copy link
Author

Closing the issue, seems there was a problem with 10.9.1 update. No longer see this error in log with 10.9.2 update.

Issue Triage for Main Repo automation moved this from Needs triage to Closed/Done May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

6 participants