[Bug] Playback fails with http error 400 when playing with kodi, jellyfin for android, findroid #7590

Closed
opened 2025-12-22 06:07:33 +01:00 by backuprepo · 10 comments
Owner

Originally created by @saikimecky on GitHub (Oct 27, 2025).

Description of the bug

After upgrading to Jellyfin.Server 10.11.1.0 playback with Kodi and the Jellyfin-kodi-plugin fails. Kodi throws an error message: "General error", in kodi.log i can see a http 400 Error.

Reproduction steps

  1. Start Kodi with jellyfin-plugin (latest stable versions)
  2. Try to start a random movie or serial
  3. Error appears immediately, no playback

What is the current bug behavior?

Movie doesnt load/playback on Kodi.

Worked in Versions before 10.11.1.0.

Please ignore the timestamps in the logs. They differ cause i ran the test multiple times. Clients and Server are in time sync ;)

What is the expected correct behavior?

Movies should play with kodi and kodi-plugin.

Jellyfin Server version

10.10.0+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

Jellyfin.Server 10.11.1.0

Specify the build version

10.11.0

Environment

- OS: Debian Oldstable 
- Linux Kernel: Linux nuc 6.12.43+deb12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.43-1~bpo12+1 (2025-09-06) x86_64 GNU/Linux
- Virtualization: no
- Clients: kodi ARM64 and Kodi x64 via kodi-plugin (stable versions both)
- Browser: none - works in Browser
- FFmpeg Version: ffmpeg version 7.1.2-Jellyfin
- Playback Method: kodi-plugin
- Hardware Acceleration: yes
- GPU Model: Intel N100 / Intel 630
- Plugins: AudioDB

10.11.1.0 Active

Intro Skipper

1.10.11.7 Active

Kodi Sync Queue

15.0.0.0 Active

MusicBrainz

10.11.1.0 Active

OMDb

10.11.1.0 Active

Playback Reporting

17.0.0.0 Active

Studio Images

10.11.1.0 Active

TMDb

10.11.1.0 Active
- Reverse Proxy: none
- Base URL: IP
- Networking: Local
- Jellyfin Data Storage: SSD
- Media Storage: HDD
- External Integrations: none

Jellyfin logs

Okt 27 12:53:09 nuc jellyfin[3373509]: [12:53:09] [INF] User policy for stefan. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
Okt 27 12:53:09 nuc jellyfin[3373509]: [12:53:09] [ERR] Error processing request. URL GET /Videos/86d57009047fd95f05ddb40c851936fa/stream.
Okt 27 12:53:09 nuc jellyfin[3373509]: System.ArgumentOutOfRangeException:  (Parameter 'count')
Okt 27 12:53:09 nuc jellyfin[3373509]: Actual value was 3066564439.
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Http.SendFileFallback.SendFileAsync(Stream destination, String filePath, Int64 offset, Nullable`1 count, CancellationToken cancellationToken)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Http.SendFileResponseExtensions.SendFileAsyncCore(HttpResponse response, String fileName, Int64 offset, Nullable`1 count, CancellationToken cancellationToken)
Okt 27 12:53:09 nuc jellyfin[3373509]:    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)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
Okt 27 12:53:09 nuc jellyfin[3373509]: --- End of stack trace from previous location ---
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
Okt 27 12:53:09 nuc jellyfin[3373509]: --- End of stack trace from previous location ---
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
Okt 27 12:53:09 nuc jellyfin[3373509]:    at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
Okt 27 12:53:09 nuc jellyfin[3373509]: [12:53:09] [ERR] Connection id "0HNGL9MTLSM19", Request id "0HNGL9MTLSM19:00000001": An unhandled exception was thrown by the application.
Okt 27 12:53:09 nuc jellyfin[3373509]: System.InvalidOperationException: Response Content-Length mismatch: too few bytes written (25 of 3066564439).

FFmpeg logs


Client / Browser logs

2025-10-27 12:33:31.664 T:19353 info : JELLYFIN -> INFO::jellyfin_kodi/jellyfin/init.py:98 ---[ START JELLYFINCLIENT ]---
2025-10-27 12:33:31.674 T:19353 info : JELLYFIN.jellyfin_kodi.entrypoint.default -> INFO::jellyfin_kodi/entrypoint/default.py:90 path: ?filename=Easy+Rider+%281969%29+1080p+AC3.mkv&id=86d57009047fd95f05ddb40c851936fa&dbid=1222&mode=play params: {
"filename": "Easy Rider (1969) 1080p AC3.mkv",
"id": "86d57009047fd95f05ddb40c851936fa",
"dbid": "1222",
"mode": "play"
}
2025-10-27 12:33:31.869 T:19353 info : JELLYFIN.jellyfin_kodi.objects.actions -> INFO::jellyfin_kodi/objects/actions.py:72 [ play/86d57009047fd95f05ddb40c851936fa ] Easy Rider
2025-10-27 12:33:32.080 T:19353 info : JELLYFIN.jellyfin_kodi.helper.playutils -> INFO::jellyfin_kodi/helper/playutils.py:83 {'MediaSources': [{'Protocol': 'File', 'Id': '86d57009047fd95f05ddb40c851936fa', 'Path': '/srv/Datenpool/Datengrab/kodi/Filme/Easy Rider (1969)/Easy Rider (1969) 1080p AC3.mkv', 'Type': 'Default', 'Container': 'mkv', 'Size': 3066564439, 'Name': 'Easy Rider (1969) 1080p AC3', 'IsRemote': False, 'ETag': '2c068cb708fc4bab79d44ce80cfb1f68', 'RunTimeTicks': 57338110000, 'ReadAtNativeFramerate': False, 'IgnoreDts': False, 'IgnoreIndex': False, 'GenPtsInput': False, 'SupportsTranscoding': True, 'SupportsDirectStream': True, 'SupportsDirectPlay': True, 'IsInfiniteStream': False, 'UseMostCompatibleTranscodingProfile': False, 'RequiresOpening': False, 'RequiresClosing': False, 'RequiresLooping': False, 'SupportsProbing': True, 'VideoType': 'VideoFile', 'MediaStreams': [{'Codec': 'hevc', 'ColorSpace': 'bt709', 'ColorTransfer': 'bt709', 'ColorPrimaries': 'bt709', 'TimeBase': '1/1000', 'VideoRange': 'SDR', 'VideoRangeType': 'SDR', 'AudioSpatialFormat': 'None', 'DisplayTitle': '1080p HEVC SDR', 'IsInterlaced': False, 'IsAVC': False, 'BitRate': 4278570, 'BitDepth': 8, 'RefFrames': 1, 'IsDefault': True, 'IsForced': False, 'IsHearingImpaired': False, 'Height': 1040, 'Width': 1920, 'AverageFrameRate': 23.976025, 'RealFrameRate': 23.976025, 'ReferenceFrameRate': 23.976025, 'Profile': 'Main', 'Type': 'Video', 'AspectRatio': '1.85:1', 'Index': 0, 'IsExternal': False, 'IsTextSubtitleStream': False, 'SupportsExternalStream': False, 'PixelFormat': 'yuv420p', 'Level': 120, 'IsAnamorphic': False}, {'Codec': 'ac3', 'Language': 'deu', 'TimeBase': '1/1000', 'VideoRange': 'Unknown', 'VideoRangeType': 'Unknown', 'AudioSpatialFormat': 'None', 'LocalizedDefault': 'Standard', 'LocalizedExternal': 'Extern', 'DisplayTitle': 'Deutsch - Dolby Digital - 5.1 - Standard', 'IsInterlaced': False, 'IsAVC': False, 'ChannelLayout': '5.1', 'BitRate': 640000, 'Channels': 6, 'SampleRate': 48000, 'IsDefault': True, 'IsForced': True, 'IsHearingImpaired': False, 'Type': 'Audio', 'Index': 1, 'IsExternal': False, 'IsTextSubtitleStream': False, 'SupportsExternalStream': False, 'Level': 0}, {'Codec': 'ac3', 'Language': 'eng', 'TimeBase': '1/1000', 'VideoRange': 'Unknown', 'VideoRangeType': 'Unknown', 'AudioSpatialFormat': 'None', 'LocalizedDefault': 'Standard', 'LocalizedExternal': 'Extern', 'DisplayTitle': 'Englisch - Dolby Digital - 5.1', 'IsInterlaced': False, 'IsAVC': False, 'ChannelLayout': '5.1', 'BitRate': 640000, 'Channels': 6, 'SampleRate': 48000, 'IsDefault': False, 'IsForced': False, 'IsHearingImpaired': False, 'Type': 'Audio', 'Index': 2, 'IsExternal': False, 'IsTextSubtitleStream': False, 'SupportsExternalStream': False, 'Level': 0}], 'MediaAttachments': [], 'Formats': [], 'Bitrate': 5558570, 'RequiredHttpHeaders': {}, 'TranscodingSubProtocol': 'http', 'DefaultAudioStreamIndex': 1, 'HasSegments': True}], 'PlaySessionId': 'cafd52b0e24b4337b48ae81302815cb6'}
2025-10-27 12:33:32.089 T:19353 info : JELLYFIN.jellyfin_kodi.helper.playutils -> INFO::jellyfin_kodi/helper/playutils.py:100 Skip source selection.
2025-10-27 12:33:32.106 T:19353 info : JELLYFIN.jellyfin_kodi.helper.playutils -> INFO::jellyfin_kodi/helper/playutils.py:209 --[ direct stream ]
2025-10-27 12:33:32.422 T:19353 warning : ListItem.setCast() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.setCast().
2025-10-27 12:33:32.437 T:19353 warning : "totaltime" in ListItem.setProperty() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.setResumePoint().
2025-10-27 12:33:32.437 T:19353 warning : "resumetime" in ListItem.setProperty() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.setResumePoint().
2025-10-27 12:33:32.438 T:19353 warning : ListItem.addStreamInfo() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.addVideoStream(), InfoTagVideo.addAudioStream() and InfoTagVideo.addSubtitleStream().
2025-10-27 12:33:32.438 T:19353 info : Skipped 2 duplicate messages..
2025-10-27 12:33:32.438 T:19353 warning : Setting most video properties through ListItem.setInfo() is deprecated and might be removed in future Kodi versions. Please use the respective setter in InfoTagVideo.
2025-10-27 12:33:32.451 T:19353 info : JELLYFIN.main -> INFO::default.py:25 ---<[ default ]
2025-10-27 12:33:32.483 T:17245 info : VideoPlayer::OpenFile: plugin://plugin.video.jellyfin/7a2175bccb1f1a94152cbd2b2bae8f6d/?filename=Easy+Rider+%281969%29+1080p+AC3.mkv&id=86d57009047fd95f05ddb40c851936fa&dbid=1222&mode=play
2025-10-27 12:33:32.485 T:19359 info : Creating InputStream
2025-10-27 12:33:32.517 T:19359 error : CCurlFile::CReadState::FillBuffer - (0x7c6e0140) Failed: HTTP returned code 400
2025-10-27 12:33:32.517 T:19359 error : CCurlFile::Open - http://192.168.180.106:8096/Videos/86d57009047fd95f05ddb40c851936fa/stream?static=true&MediaSourceId=86d57009047fd95f05ddb40c851936fa&api_key=f50480ea1fd742d885f582a1fd3aa571 Failed with code 400:

2025-10-27 12:33:32.518 T:19359 error : CFileCache::Open - http://192.168.180.106:8096/Videos/86d57009047fd95f05ddb40c851936fa/stream?static=true&MediaSourceId=86d57009047fd95f05ddb40c851936fa&api_key=f50480ea1fd742d885f582a1fd3aa571 failed to open
2025-10-27 12:33:32.518 T:19359 error : CVideoPlayer::OpenInputStream - error opening [plugin://plugin.video.jellyfin/7a2175bccb1f1a94152cbd2b2bae8f6d/?filename=Easy+Rider+%281969%29+1080p+AC3.mkv&id=86d57009047fd95f05ddb40c851936fa&dbid=1222&mode=play]
2025-10-27 12:33:32.518 T:19359 info : CVideoPlayer::OnExit()
2025-10-27 12:33:32.529 T:17325 info : Deleting settings information for files plugin://plugin.video.jellyfin/7a2175bccb1f1a94152cbd2b2bae8f6d/?filename=Easy+Rider+%281969%29+1080p+AC3.mkv&id=86d57009047fd95f05ddb40c851936fa&dbid=1222&mode=play
2025-10-27 12:33:32.613 T:17245 info : CVideoPlayer::CloseFile()
2025-10-27 12:33:32.614 T:17245 info : VideoPlayer: waiting for threads to exit
2025-10-27 12:33:32.614 T:17245 info : VideoPlayer: finished waiting
2025-10-27 12:33:32.675 T:17331 error : EXCEPTION: Kodi is not playing any file
2025-10-27 12:33:32.797 T:17382 info : Skipped 2 duplicate messages..
2025-10-27 12:33:32.796 T:17382 info : JELLYFIN.jellyfin_kodi.objects.actions -> INFO::jellyfin_kodi/objects/actions.py:863 [ play ] kodi_id: 1222 media: movie
2025-10-27 12:33:32.928 T:17382 info : JELLYFIN.jellyfin_kodi.player -> INFO::jellyfin_kodi/player.py:394 --<[ playback ]
2025-10-27 12:33:36.031 T:17382 info : JELLYFIN.jellyfin_kodi.monitor -> INFO::jellyfin_kodi/monitor.py:105 [ playlist ] cleared
2025-10-27 12:33:36.032 T:17382 error : EXCEPTION: Kodi is not playing any file
2025-10-27 12:33:39.270 T:17245 info : Skipped 3 duplicate messages..
2025-10-27 12:33:39.270 T:17245 info : Loading skin file: Settings.xml, load type: KEEP_IN_MEMORY
2025-10-27 12:33:40.044 T:17382 info : JELLYFIN.jellyfin_kodi.player -> INFO::jellyfin_kodi/player.py:72 Cancel playback report
2025-10-27 12:33:41.322 T:17245 info : Attempting to default to:
2025-10-27 12:33:41.323 T:17245 info : Loading skin file: FileManager.xml, load type: KEEP_IN_MEMORY
2025-10-27 12:33:52.218 T:17245 info : Loading skin file: DialogTextViewer.xml, load type: KEEP_IN_MEMORY

Relevant screenshots or videos

No response

Additional information

No response

Originally created by @saikimecky on GitHub (Oct 27, 2025). ### Description of the bug After upgrading to Jellyfin.Server 10.11.1.0 playback with Kodi and the Jellyfin-kodi-plugin fails. Kodi throws an error message: "General error", in kodi.log i can see a http 400 Error. ### Reproduction steps 1. Start Kodi with jellyfin-plugin (latest stable versions) 2. Try to start a random movie or serial 3. Error appears immediately, no playback ### What is the current _bug_ behavior? Movie doesnt load/playback on Kodi. Worked in Versions before 10.11.1.0. Please ignore the timestamps in the logs. They differ cause i ran the test multiple times. Clients and Server are in time sync ;) ### What is the expected _correct_ behavior? Movies should play with kodi and kodi-plugin. ### Jellyfin Server version 10.10.0+ ### Specify commit id _No response_ ### Specify unstable release number _No response_ ### Specify version number Jellyfin.Server 10.11.1.0 ### Specify the build version 10.11.0 ### Environment ```markdown - OS: Debian Oldstable - Linux Kernel: Linux nuc 6.12.43+deb12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.43-1~bpo12+1 (2025-09-06) x86_64 GNU/Linux - Virtualization: no - Clients: kodi ARM64 and Kodi x64 via kodi-plugin (stable versions both) - Browser: none - works in Browser - FFmpeg Version: ffmpeg version 7.1.2-Jellyfin - Playback Method: kodi-plugin - Hardware Acceleration: yes - GPU Model: Intel N100 / Intel 630 - Plugins: AudioDB 10.11.1.0 Active Intro Skipper 1.10.11.7 Active Kodi Sync Queue 15.0.0.0 Active MusicBrainz 10.11.1.0 Active OMDb 10.11.1.0 Active Playback Reporting 17.0.0.0 Active Studio Images 10.11.1.0 Active TMDb 10.11.1.0 Active - Reverse Proxy: none - Base URL: IP - Networking: Local - Jellyfin Data Storage: SSD - Media Storage: HDD - External Integrations: none ``` ### Jellyfin logs ```shell Okt 27 12:53:09 nuc jellyfin[3373509]: [12:53:09] [INF] User policy for stefan. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True Okt 27 12:53:09 nuc jellyfin[3373509]: [12:53:09] [ERR] Error processing request. URL GET /Videos/86d57009047fd95f05ddb40c851936fa/stream. Okt 27 12:53:09 nuc jellyfin[3373509]: System.ArgumentOutOfRangeException: (Parameter 'count') Okt 27 12:53:09 nuc jellyfin[3373509]: Actual value was 3066564439. Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Http.SendFileFallback.SendFileAsync(Stream destination, String filePath, Int64 offset, Nullable`1 count, CancellationToken cancellationToken) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Http.SendFileResponseExtensions.SendFileAsyncCore(HttpResponse response, String fileName, Int64 offset, Nullable`1 count, CancellationToken cancellationToken) Okt 27 12:53:09 nuc jellyfin[3373509]: 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) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters() Okt 27 12:53:09 nuc jellyfin[3373509]: --- End of stack trace from previous location --- Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() Okt 27 12:53:09 nuc jellyfin[3373509]: --- End of stack trace from previous location --- Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Okt 27 12:53:09 nuc jellyfin[3373509]: at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager) Okt 27 12:53:09 nuc jellyfin[3373509]: at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager) Okt 27 12:53:09 nuc jellyfin[3373509]: at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Okt 27 12:53:09 nuc jellyfin[3373509]: at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext) Okt 27 12:53:09 nuc jellyfin[3373509]: at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext) Okt 27 12:53:09 nuc jellyfin[3373509]: at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Okt 27 12:53:09 nuc jellyfin[3373509]: at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Okt 27 12:53:09 nuc jellyfin[3373509]: at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) Okt 27 12:53:09 nuc jellyfin[3373509]: at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) Okt 27 12:53:09 nuc jellyfin[3373509]: at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context) Okt 27 12:53:09 nuc jellyfin[3373509]: at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) Okt 27 12:53:09 nuc jellyfin[3373509]: at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context) Okt 27 12:53:09 nuc jellyfin[3373509]: [12:53:09] [ERR] Connection id "0HNGL9MTLSM19", Request id "0HNGL9MTLSM19:00000001": An unhandled exception was thrown by the application. Okt 27 12:53:09 nuc jellyfin[3373509]: System.InvalidOperationException: Response Content-Length mismatch: too few bytes written (25 of 3066564439). ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs 2025-10-27 12:33:31.664 T:19353 info <general>: JELLYFIN -> INFO::jellyfin_kodi/jellyfin/__init__.py:98 ---[ START JELLYFINCLIENT ]--- 2025-10-27 12:33:31.674 T:19353 info <general>: JELLYFIN.jellyfin_kodi.entrypoint.default -> INFO::jellyfin_kodi/entrypoint/default.py:90 path: ?filename=Easy+Rider+%281969%29+1080p+AC3.mkv&id=86d57009047fd95f05ddb40c851936fa&dbid=1222&mode=play params: { "filename": "Easy Rider (1969) 1080p AC3.mkv", "id": "86d57009047fd95f05ddb40c851936fa", "dbid": "1222", "mode": "play" } 2025-10-27 12:33:31.869 T:19353 info <general>: JELLYFIN.jellyfin_kodi.objects.actions -> INFO::jellyfin_kodi/objects/actions.py:72 [ play/86d57009047fd95f05ddb40c851936fa ] Easy Rider 2025-10-27 12:33:32.080 T:19353 info <general>: JELLYFIN.jellyfin_kodi.helper.playutils -> INFO::jellyfin_kodi/helper/playutils.py:83 {'MediaSources': [{'Protocol': 'File', 'Id': '86d57009047fd95f05ddb40c851936fa', 'Path': '/srv/Datenpool/Datengrab/kodi/Filme/Easy Rider (1969)/Easy Rider (1969) 1080p AC3.mkv', 'Type': 'Default', 'Container': 'mkv', 'Size': 3066564439, 'Name': 'Easy Rider (1969) 1080p AC3', 'IsRemote': False, 'ETag': '2c068cb708fc4bab79d44ce80cfb1f68', 'RunTimeTicks': 57338110000, 'ReadAtNativeFramerate': False, 'IgnoreDts': False, 'IgnoreIndex': False, 'GenPtsInput': False, 'SupportsTranscoding': True, 'SupportsDirectStream': True, 'SupportsDirectPlay': True, 'IsInfiniteStream': False, 'UseMostCompatibleTranscodingProfile': False, 'RequiresOpening': False, 'RequiresClosing': False, 'RequiresLooping': False, 'SupportsProbing': True, 'VideoType': 'VideoFile', 'MediaStreams': [{'Codec': 'hevc', 'ColorSpace': 'bt709', 'ColorTransfer': 'bt709', 'ColorPrimaries': 'bt709', 'TimeBase': '1/1000', 'VideoRange': 'SDR', 'VideoRangeType': 'SDR', 'AudioSpatialFormat': 'None', 'DisplayTitle': '1080p HEVC SDR', 'IsInterlaced': False, 'IsAVC': False, 'BitRate': 4278570, 'BitDepth': 8, 'RefFrames': 1, 'IsDefault': True, 'IsForced': False, 'IsHearingImpaired': False, 'Height': 1040, 'Width': 1920, 'AverageFrameRate': 23.976025, 'RealFrameRate': 23.976025, 'ReferenceFrameRate': 23.976025, 'Profile': 'Main', 'Type': 'Video', 'AspectRatio': '1.85:1', 'Index': 0, 'IsExternal': False, 'IsTextSubtitleStream': False, 'SupportsExternalStream': False, 'PixelFormat': 'yuv420p', 'Level': 120, 'IsAnamorphic': False}, {'Codec': 'ac3', 'Language': 'deu', 'TimeBase': '1/1000', 'VideoRange': 'Unknown', 'VideoRangeType': 'Unknown', 'AudioSpatialFormat': 'None', 'LocalizedDefault': 'Standard', 'LocalizedExternal': 'Extern', 'DisplayTitle': 'Deutsch - Dolby Digital - 5.1 - Standard', 'IsInterlaced': False, 'IsAVC': False, 'ChannelLayout': '5.1', 'BitRate': 640000, 'Channels': 6, 'SampleRate': 48000, 'IsDefault': True, 'IsForced': True, 'IsHearingImpaired': False, 'Type': 'Audio', 'Index': 1, 'IsExternal': False, 'IsTextSubtitleStream': False, 'SupportsExternalStream': False, 'Level': 0}, {'Codec': 'ac3', 'Language': 'eng', 'TimeBase': '1/1000', 'VideoRange': 'Unknown', 'VideoRangeType': 'Unknown', 'AudioSpatialFormat': 'None', 'LocalizedDefault': 'Standard', 'LocalizedExternal': 'Extern', 'DisplayTitle': 'Englisch - Dolby Digital - 5.1', 'IsInterlaced': False, 'IsAVC': False, 'ChannelLayout': '5.1', 'BitRate': 640000, 'Channels': 6, 'SampleRate': 48000, 'IsDefault': False, 'IsForced': False, 'IsHearingImpaired': False, 'Type': 'Audio', 'Index': 2, 'IsExternal': False, 'IsTextSubtitleStream': False, 'SupportsExternalStream': False, 'Level': 0}], 'MediaAttachments': [], 'Formats': [], 'Bitrate': 5558570, 'RequiredHttpHeaders': {}, 'TranscodingSubProtocol': 'http', 'DefaultAudioStreamIndex': 1, 'HasSegments': True}], 'PlaySessionId': 'cafd52b0e24b4337b48ae81302815cb6'} 2025-10-27 12:33:32.089 T:19353 info <general>: JELLYFIN.jellyfin_kodi.helper.playutils -> INFO::jellyfin_kodi/helper/playutils.py:100 Skip source selection. 2025-10-27 12:33:32.106 T:19353 info <general>: JELLYFIN.jellyfin_kodi.helper.playutils -> INFO::jellyfin_kodi/helper/playutils.py:209 --[ direct stream ] 2025-10-27 12:33:32.422 T:19353 warning <general>: ListItem.setCast() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.setCast(). 2025-10-27 12:33:32.437 T:19353 warning <general>: "totaltime" in ListItem.setProperty() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.setResumePoint(). 2025-10-27 12:33:32.437 T:19353 warning <general>: "resumetime" in ListItem.setProperty() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.setResumePoint(). 2025-10-27 12:33:32.438 T:19353 warning <general>: ListItem.addStreamInfo() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.addVideoStream(), InfoTagVideo.addAudioStream() and InfoTagVideo.addSubtitleStream(). 2025-10-27 12:33:32.438 T:19353 info <general>: Skipped 2 duplicate messages.. 2025-10-27 12:33:32.438 T:19353 warning <general>: Setting most video properties through ListItem.setInfo() is deprecated and might be removed in future Kodi versions. Please use the respective setter in InfoTagVideo. 2025-10-27 12:33:32.451 T:19353 info <general>: JELLYFIN.__main__ -> INFO::default.py:25 ---<[ default ] 2025-10-27 12:33:32.483 T:17245 info <general>: VideoPlayer::OpenFile: plugin://plugin.video.jellyfin/7a2175bccb1f1a94152cbd2b2bae8f6d/?filename=Easy+Rider+%281969%29+1080p+AC3.mkv&id=86d57009047fd95f05ddb40c851936fa&dbid=1222&mode=play 2025-10-27 12:33:32.485 T:19359 info <general>: Creating InputStream 2025-10-27 12:33:32.517 T:19359 error <general>: CCurlFile::CReadState::FillBuffer - (0x7c6e0140) Failed: HTTP returned code 400 2025-10-27 12:33:32.517 T:19359 error <general>: CCurlFile::Open - <http://192.168.180.106:8096/Videos/86d57009047fd95f05ddb40c851936fa/stream?static=true&MediaSourceId=86d57009047fd95f05ddb40c851936fa&api_key=f50480ea1fd742d885f582a1fd3aa571> Failed with code 400: 2025-10-27 12:33:32.518 T:19359 error <general>: CFileCache::Open - <http://192.168.180.106:8096/Videos/86d57009047fd95f05ddb40c851936fa/stream?static=true&MediaSourceId=86d57009047fd95f05ddb40c851936fa&api_key=f50480ea1fd742d885f582a1fd3aa571> failed to open 2025-10-27 12:33:32.518 T:19359 error <general>: CVideoPlayer::OpenInputStream - error opening [plugin://plugin.video.jellyfin/7a2175bccb1f1a94152cbd2b2bae8f6d/?filename=Easy+Rider+%281969%29+1080p+AC3.mkv&id=86d57009047fd95f05ddb40c851936fa&dbid=1222&mode=play] 2025-10-27 12:33:32.518 T:19359 info <general>: CVideoPlayer::OnExit() 2025-10-27 12:33:32.529 T:17325 info <general>: Deleting settings information for files plugin://plugin.video.jellyfin/7a2175bccb1f1a94152cbd2b2bae8f6d/?filename=Easy+Rider+%281969%29+1080p+AC3.mkv&id=86d57009047fd95f05ddb40c851936fa&dbid=1222&mode=play 2025-10-27 12:33:32.613 T:17245 info <general>: CVideoPlayer::CloseFile() 2025-10-27 12:33:32.614 T:17245 info <general>: VideoPlayer: waiting for threads to exit 2025-10-27 12:33:32.614 T:17245 info <general>: VideoPlayer: finished waiting 2025-10-27 12:33:32.675 T:17331 error <general>: EXCEPTION: Kodi is not playing any file 2025-10-27 12:33:32.797 T:17382 info <general>: Skipped 2 duplicate messages.. 2025-10-27 12:33:32.796 T:17382 info <general>: JELLYFIN.jellyfin_kodi.objects.actions -> INFO::jellyfin_kodi/objects/actions.py:863 [ play ] kodi_id: 1222 media: movie 2025-10-27 12:33:32.928 T:17382 info <general>: JELLYFIN.jellyfin_kodi.player -> INFO::jellyfin_kodi/player.py:394 --<[ playback ] 2025-10-27 12:33:36.031 T:17382 info <general>: JELLYFIN.jellyfin_kodi.monitor -> INFO::jellyfin_kodi/monitor.py:105 [ playlist ] cleared 2025-10-27 12:33:36.032 T:17382 error <general>: EXCEPTION: Kodi is not playing any file 2025-10-27 12:33:39.270 T:17245 info <general>: Skipped 3 duplicate messages.. 2025-10-27 12:33:39.270 T:17245 info <general>: Loading skin file: Settings.xml, load type: KEEP_IN_MEMORY 2025-10-27 12:33:40.044 T:17382 info <general>: JELLYFIN.jellyfin_kodi.player -> INFO::jellyfin_kodi/player.py:72 Cancel playback report 2025-10-27 12:33:41.322 T:17245 info <general>: Attempting to default to: 2025-10-27 12:33:41.323 T:17245 info <general>: Loading skin file: FileManager.xml, load type: KEEP_IN_MEMORY 2025-10-27 12:33:52.218 T:17245 info <general>: Loading skin file: DialogTextViewer.xml, load type: KEEP_IN_MEMORY ### Relevant screenshots or videos _No response_ ### Additional information _No response_
backuprepo 2025-12-22 06:07:33 +01:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@saikimecky commented on GitHub (Oct 28, 2025):

Further testing: Playback fails with "Source Error" on Findroid and the native jellyfin android app, too.

@saikimecky commented on GitHub (Oct 28, 2025): Further testing: Playback fails with "Source Error" on Findroid and the native jellyfin android app, too.
Author
Owner

@FerrahWolfeh commented on GitHub (Oct 28, 2025):

This seems to be related to bad parsing of some MKV files.
I've been digging through my library and this error occurs mostly when the video file (in my case) is a mkv file with an av1 video stream, an opus audio stream, subtitles and font file attachments. Apparently, jellyfin misinterprets these files as webm instead of mkv and fails to parse both subs and attachments without resorting to transcoding instead of remuxing.

When I converted this same file to hevc, direct play and HLS remux started working as usual.

@FerrahWolfeh commented on GitHub (Oct 28, 2025): This seems to be related to bad parsing of some MKV files. I've been digging through my library and this error occurs mostly when the video file (in my case) is a mkv file with an av1 video stream, an opus audio stream, subtitles and font file attachments. Apparently, jellyfin misinterprets these files as webm instead of mkv and fails to parse both subs and attachments without resorting to transcoding instead of remuxing. When I converted this same file to hevc, direct play and HLS remux started working as usual.
Author
Owner

@saikimecky commented on GitHub (Oct 28, 2025):

This seems to be related to bad parsing of some MKV files.
...
When I converted this same file to hevc, direct play and HLS remux started working as usual.

Oh yes, its the same here. h264 works. h265 not.

Thought it got something to do with ffmpeg7. so i tried downgrading this with no success. ffmpeg7 seems not responsible for the errors we see.

@saikimecky commented on GitHub (Oct 28, 2025): > This seems to be related to bad parsing of some MKV files. > ... > When I converted this same file to hevc, direct play and HLS remux started working as usual. Oh yes, its the same here. h264 works. h265 not. Thought it got something to do with ffmpeg7. so i tried downgrading this with no success. ffmpeg7 seems not responsible for the errors we see.
Author
Owner

@leo9800 commented on GitHub (Nov 3, 2025):

I could confirm this issue and did some further investigations:

  1. this issue seems have no relationship with codecs of videos. a common H264/SDR+AAC videos also fails playback on jellyfin-media-player on my linux box.
  2. this issue seems have no relationship with matroska container (mkv) either. .mp4 containered videos also failed playbacks.
  3. by checking logs of JMP I noticed 400 bad request with the playback link, e.g. https://jellyfin.invalid.test/Videos/21da73ec28cd4ed128384ec61cec51fa/stream.mkv?Static=true&mediaSourceId=21da73ec28cd4ed128384ec61cec51fa&deviceId=SmVsbHlmaW5NZWRpYVBsYXllciAxLjEyLjAgKGxpbnV4LXg4Nl82NCB1bmtub3duKXwxNzQzNTA2OTQxNzkw&ApiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&Tag=22c7c9d919c4f56cc2fed48b9abb31eb
  4. this link could be downloaded with curl and the file could be playback properly with vlc or mpv, i.e. curl https://jellyfin.invalid.test/Videos/21da73ec28cd4ed128384ec61cec51fa/stream.mkv?Static=true&mediaSourceId=21da73ec28cd4ed128384ec61cec51fa&deviceId=SmVsbHlmaW5NZWRpYVBsYXllciAxLjEyLjAgKGxpbnV4LXg4Nl82NCB1bmtub3duKXwxNzQzNTA2OTQxNzkw&ApiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&Tag=22c7c9d919c4f56cc2fed48b9abb31eb; vlc stream.mkv worked like a charm
  5. this link could NOT be playback with vlc/mpv/ffmpeg directly, trying so results in 400 bad request, which is consistent with the error log from JMP
  6. transcoded playbacks works fine with JMP, direct streaming would fail
  7. both direct streaming and transcoding playbacks worked with jellyfin-web

above all i believe @saikimecky and @FerrahWolfeh were not correct, this issue is not codec/container-dependent. i believe it is somehow io/networking related. the log on my server indicates:

[2025-11-03 07:39:21.623 +00:00] [ERR] [31] Microsoft.AspNetCore.Server.Kestrel: Connection id ""0HNGQL7K2JG3D"", Request id ""0HNGQL7K2JG3D:00000001"": An unhandled exception was thrown by the application.
System.InvalidOperationException: Response Content-Length mismatch: too few bytes written (25 of 2595727369).
[2025-11-03 07:39:22.458 +00:00] [INF] [31] Jellyfin.Api.Auth.CustomAuthenticationHandler: "CustomAuthentication" was not authenticated. Failure message: "Invalid token."
[2025-11-03 07:39:22.463 +00:00] [ERR] [31] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/Videos/21da73ec28cd4ed128384ec61cec51fa/stream.mkv".
System.ArgumentOutOfRangeException:  (Parameter 'count')
Actual value was 2595727369.
   at Microsoft.AspNetCore.Http.SendFileFallback.SendFileAsync(Stream destination, String filePath, Int64 offset, Nullable`1 count, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Http.SendFileResponseExtensions.SendFileAsyncCore(HttpResponse response, String fileName, Int64 offset, Nullable`1 count, CancellationToken cancellationToken)
   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()
--- 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 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 Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

be noticed that parameter count only exists in

  • Microsoft.AspNetCore.Http.SendFileFallback.SendFileAsync(Stream destination, String filePath, Int64 offset, Nullable1 count, CancellationToken cancellationToken)`
  • Microsoft.AspNetCore.Http.SendFileResponseExtensions.SendFileAsyncCore(HttpResponse response, String fileName, Int64 offset, Nullable1 count, CancellationToken cancellationToken)`

and the out-of-bounded value is not exactly the same (3066564439 vs 2595727369)

@leo9800 commented on GitHub (Nov 3, 2025): I could confirm this issue and did some further investigations: 1. this issue seems have no relationship with codecs of videos. a common H264/SDR+AAC videos also fails playback on jellyfin-media-player on my linux box. 2. this issue seems have no relationship with matroska container (`mkv`) either. `.mp4` containered videos also failed playbacks. 3. by checking logs of JMP I noticed 400 bad request with the playback link, e.g. `https://jellyfin.invalid.test/Videos/21da73ec28cd4ed128384ec61cec51fa/stream.mkv?Static=true&mediaSourceId=21da73ec28cd4ed128384ec61cec51fa&deviceId=SmVsbHlmaW5NZWRpYVBsYXllciAxLjEyLjAgKGxpbnV4LXg4Nl82NCB1bmtub3duKXwxNzQzNTA2OTQxNzkw&ApiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&Tag=22c7c9d919c4f56cc2fed48b9abb31eb` 4. this link could be downloaded with curl and the file could be playback properly with vlc or mpv, i.e. `curl https://jellyfin.invalid.test/Videos/21da73ec28cd4ed128384ec61cec51fa/stream.mkv?Static=true&mediaSourceId=21da73ec28cd4ed128384ec61cec51fa&deviceId=SmVsbHlmaW5NZWRpYVBsYXllciAxLjEyLjAgKGxpbnV4LXg4Nl82NCB1bmtub3duKXwxNzQzNTA2OTQxNzkw&ApiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&Tag=22c7c9d919c4f56cc2fed48b9abb31eb; vlc stream.mkv` worked like a charm 5. this link could NOT be playback with vlc/mpv/ffmpeg directly, trying so results in 400 bad request, which is consistent with the error log from JMP 6. transcoded playbacks works fine with JMP, direct streaming would fail 7. both direct streaming and transcoding playbacks worked with jellyfin-web above all i believe @saikimecky and @FerrahWolfeh were not correct, this issue is not codec/container-dependent. i believe it is somehow io/networking related. the log on my server indicates: ``` [2025-11-03 07:39:21.623 +00:00] [ERR] [31] Microsoft.AspNetCore.Server.Kestrel: Connection id ""0HNGQL7K2JG3D"", Request id ""0HNGQL7K2JG3D:00000001"": An unhandled exception was thrown by the application. System.InvalidOperationException: Response Content-Length mismatch: too few bytes written (25 of 2595727369). [2025-11-03 07:39:22.458 +00:00] [INF] [31] Jellyfin.Api.Auth.CustomAuthenticationHandler: "CustomAuthentication" was not authenticated. Failure message: "Invalid token." [2025-11-03 07:39:22.463 +00:00] [ERR] [31] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/Videos/21da73ec28cd4ed128384ec61cec51fa/stream.mkv". System.ArgumentOutOfRangeException: (Parameter 'count') Actual value was 2595727369. at Microsoft.AspNetCore.Http.SendFileFallback.SendFileAsync(Stream destination, String filePath, Int64 offset, Nullable`1 count, CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.SendFileResponseExtensions.SendFileAsyncCore(HttpResponse response, String fileName, Int64 offset, Nullable`1 count, CancellationToken cancellationToken) 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() --- 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 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 Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context) ``` be noticed that parameter `count` only exists in - `Microsoft.AspNetCore.Http.SendFileFallback.SendFileAsync(Stream destination, String filePath, Int64 offset, Nullable`1 count, CancellationToken cancellationToken)` - `Microsoft.AspNetCore.Http.SendFileResponseExtensions.SendFileAsyncCore(HttpResponse response, String fileName, Int64 offset, Nullable`1 count, CancellationToken cancellationToken)` and the out-of-bounded value is not exactly the same (`3066564439` vs `2595727369`)
Author
Owner

@leo9800 commented on GitHub (Nov 3, 2025):

Update: ISSUE CAUSE IDENTIFIED, workarounds TBD ...

retrieved ssl random to master secret mapping by applying envvar SSLKEYLOGFILE to apache http server acting as reverse proxy on my server which is required for decrypting ssl sessions

by decrypting, i noticed JMP sets 2 suspicious headers in /Videos/{hash}/stream.mkv requests:

Range: bytes=0-
Icy-MetaData: 1

then I tried:

  • curl -v {url} -> results in 200
  • curl -v -H 'Icy-MetaData: 1' {url} -> results in 200
  • curl -v -H 'Icy-MetaData: 1' -H 'Range: bytes=0-' {url} -> results in 400
  • (bonus) curl -v -H 'Range: bytes=0-' {url} -> results also in 400

interestingly, curl -v -H 'Range: bytes=0-100' {url} results in 206, and the binary (octet-stream) in resp body is a valid (but truncated, definitely) matroska (mkv) payload

however, increase the range, i.e. curl -v -H 'Range: bytes=0-8192' {url}, results in 400


a dirty hack may be modify JMP code and remove the range header, but it does nothing with the root cause which is the server's fault.

the root cause is that the server fails handling range header correctly somehow.

@leo9800 commented on GitHub (Nov 3, 2025): Update: ISSUE CAUSE IDENTIFIED, workarounds TBD ... retrieved ssl random to master secret mapping by applying envvar `SSLKEYLOGFILE` to apache http server acting as reverse proxy on my server which is required for decrypting ssl sessions by decrypting, i noticed JMP sets 2 suspicious headers in `/Videos/{hash}/stream.mkv` requests: ``` Range: bytes=0- Icy-MetaData: 1 ``` then I tried: - `curl -v {url}` -> results in 200 - `curl -v -H 'Icy-MetaData: 1' {url}` -> results in 200 - `curl -v -H 'Icy-MetaData: 1' -H 'Range: bytes=0-' {url}` -> results in 400 - (bonus) `curl -v -H 'Range: bytes=0-' {url}` -> results also in 400 interestingly, `curl -v -H 'Range: bytes=0-100' {url}` results in 206, and the binary (`octet-stream`) in resp body is a valid (but truncated, definitely) matroska (mkv) payload however, increase the range, i.e. `curl -v -H 'Range: bytes=0-8192' {url}`, results in 400 --------------------------- a dirty hack may be modify JMP code and remove the `range` header, but it does nothing with the root cause which is the server's fault. the root cause is that the server fails handling `range` header correctly somehow.
Author
Owner

@FerrahWolfeh commented on GitHub (Nov 3, 2025):

Interesting. So it wasn't any of the things I was expecting, but actually something deep inside the server...

But still, something happened in the new 10.11.2 version that made this issue disappear for me completely. Findroid and the webplayer on brave are working fine with direct stream while playing the problematic files.

Anyone can reproduce or confirm this?

@FerrahWolfeh commented on GitHub (Nov 3, 2025): Interesting. So it wasn't any of the things I was expecting, but actually something deep inside the server... But still, something happened in the new `10.11.2` version that made this issue disappear for me completely. Findroid and the webplayer on brave are working fine with direct stream while playing the problematic files. Anyone can reproduce or confirm this?
Author
Owner

@saikimecky commented on GitHub (Nov 3, 2025):

...

But still, something happened in the new 10.11.2 version that made this issue disappear for me completely. Findroid and the webplayer on brave are working fine with direct stream while playing the problematic files.

Anyone can reproduce or confirm this?

Updated to version 10.11.2. Still cant play in Programms, only Web works.

I still see the error when playing from kodi or get a "Source Error" in the jellyfin app:

System.InvalidOperationException: Response Content-Length mismatch: too few bytes written (25 of 387589374).

@saikimecky commented on GitHub (Nov 3, 2025): ... > But still, something happened in the new `10.11.2` version that made this issue disappear for me completely. Findroid and the webplayer on brave are working fine with direct stream while playing the problematic files. > > Anyone can reproduce or confirm this? Updated to version 10.11.2. Still cant play in Programms, only Web works. I still see the error when playing from kodi or get a "Source Error" in the jellyfin app: `System.InvalidOperationException: Response Content-Length mismatch: too few bytes written (25 of 387589374).`
Author
Owner

@leo9800 commented on GitHub (Nov 12, 2025):

update: this issue may be caused by incorrect handling of symlinked media files

it may be fixed by #15263, which addressed the bug introduced by #15209 which is included in v10.11.1, by downgrading to v10.11.0 everything worked like a charm

p.s. i tried to reproduce this issue in a new setup but it just seems disappeared, it turns out to be the media files in the new (debug) setup were not symlinks while media files are symlinks on my production setup

@leo9800 commented on GitHub (Nov 12, 2025): update: this issue may be caused by incorrect handling of symlinked media files it may be fixed by #15263, which addressed the bug introduced by #15209 which is included in v10.11.1, by downgrading to v10.11.0 everything worked like a charm p.s. i tried to reproduce this issue in a new setup but it just seems disappeared, it turns out to be the media files in the new (debug) setup were not symlinks while media files are symlinks on my production setup
Author
Owner

@3flex commented on GitHub (Nov 17, 2025):

Updated to 10.11.3 and integrated player now works again for me on Jellyfin for Android.

@3flex commented on GitHub (Nov 17, 2025): Updated to 10.11.3 and integrated player now works again for me on Jellyfin for Android.
Author
Owner

@saikimecky commented on GitHub (Nov 18, 2025):

Works with 10.11.3 again :) Bug can be closed.

@saikimecky commented on GitHub (Nov 18, 2025): Works with 10.11.3 again :) Bug can be closed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#7590
No description provided.