jellyfin/jellyfin-plugin-tvheadend

[Bug] Tvheadend timeout not loading jellyfin

Y0ngg4n opened this issue · 4 comments

If there is a tvheadend timeout, jellyfin is not loading on android TV

How to reproduce:

  • Shut down your tvheadend instance but keep the tvheadend plugin active
  • Open Jellyfin in Firefox: There will be a endless loading circle hovering over the library overview
  • Open Jellyfin in Android TV: Empty page and sometimes even crashes.

I can confirm the same behaviour. Here are my logs when opening a channel:

ul 09 13:14:26 mediaserver jellyfin[627]: [13:14:26] [INF] User policy for user. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
jul 09 13:14:26 mediaserver jellyfin[627]: [13:14:26] [INF] StreamBuilder.BuildVideoItem( Profile=Anonymous Profile, Path=Unknown path, AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=Transcode, TranscodeReason=ContainerNotSupported, VideoCodecNotSupported ) media:/videos/9abef16d-ed27-38b2-9d89-ef10c6f97c10/master.m3u8?MediaSourceId=9abef16ded2738b29d89ef10c6f97c10&VideoCodec=h264&AudioCodec=aac,mp3&VideoBitrate=139808000&AudioBitrate=192000&api_key=<token>&TranscodingMaxAudioChannels=2&RequireAvc=false&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&TranscodeReasons=ContainerNotSupported,%20VideoCodecNotSupported
jul 09 13:14:26 mediaserver jellyfin[627]: [13:14:26] [INF] Opening channel stream from TVHclient LiveTvService, external channel Id: 2114536111
jul 09 13:14:26 mediaserver jellyfin[627]: [13:14:26] [ERR] Error processing request. URL POST /Items/9abef16ded2738b29d89ef10c6f97c10/PlaybackInfo.
jul 09 13:14:26 mediaserver jellyfin[627]: System.MissingMethodException: Method not found: 'Void MediaBrowser.Model.Dto.MediaSourceInfo.set_MediaStreams(System.Collections.Generic.List`1<MediaBrowser.Model.Entities.MediaStream>)'.
jul 09 13:14:26 mediaserver jellyfin[627]:    at TVHeadEnd.LiveTvService.GetChannelStream(String channelId, String mediaSourceId, CancellationToken cancellationToken)
jul 09 13:14:26 mediaserver jellyfin[627]:    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
jul 09 13:14:26 mediaserver jellyfin[627]:    at TVHeadEnd.LiveTvService.GetChannelStream(String channelId, String mediaSourceId, CancellationToken cancellationToken)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Emby.Server.Implementations.LiveTv.LiveTvManager.GetChannelStream(String id, String mediaSourceId, List`1 currentLiveStreams, CancellationToken cancellationToken)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Emby.Server.Implementations.LiveTv.LiveTvMediaSourceProvider.OpenMediaSource(String openToken, List`1 currentLiveStreams, CancellationToken cancellationToken)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Emby.Server.Implementations.Library.MediaSourceManager.OpenLiveStreamInternal(LiveStreamRequest request, CancellationToken cancellationToken)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Emby.Server.Implementations.Library.MediaSourceManager.OpenLiveStream(LiveStreamRequest request, CancellationToken cancellationToken)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Api.Helpers.MediaInfoHelper.OpenMediaSource(HttpRequest httpRequest, LiveStreamRequest request)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Api.Controllers.MediaInfoController.GetPostedPlaybackInfo(Guid itemId, Nullable`1 userId, Nullable`1 maxStreamingBitrate, Nullable`1 startTimeTicks, Nullable`1 audioStreamIndex, Nullable`1 subtitleStreamIndex, Nullable`1 maxAudioChannels, String mediaSourceId, String liveStreamId, Nullable`1 autoOpenLiveStream, Nullable`1 enableDirectPlay, Nullable`1 enableDirectStream, Nullable`1 enableTranscoding, Nullable`1 allowVideoStreamCopy, Nullable`1 allowAudioStreamCopy, PlaybackInfoDto playbackInfoDto)
jul 09 13:14:26 mediaserver jellyfin[627]:    at lambda_method789(Closure , Object )
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
jul 09 13:14:26 mediaserver jellyfin[627]: --- End of stack trace from previous location ---
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
jul 09 13:14:26 mediaserver jellyfin[627]: --- End of stack trace from previous location ---
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Server.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Server.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Server.Middleware.IpBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Server.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Server.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Server.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
jul 09 13:14:26 mediaserver jellyfin[627]:    at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

Operating System: Debian Bookworm with all latest updates installed.
Jellyfin Version: 10.8.10
Plugin Version: 10.0.0.0

Best regards

Same thing on my system. Have tried both admin and user. Localhost and 120.0.0.1. Using Xpenology. Running kodi on a shield on same network and it pulls the (xpenology installed from synocommunity) tvheadend data without issues and displays a guide with record option showing.

Im seeing massive spam of this
[13:18:38] [ERR] [13] TVHeadEnd.HTSP.HTSConnectionAsync: [TVHclient] HTSConnectionAsync.open: exception caught
System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (111): Connection refused 172.17.0.6:9982
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at TVHeadEnd.HTSP.HTSConnectionAsync.open(String hostname, Int32 port)

@encodedpr not related to this issue, but if you need tvheadend in jellyfin, a safer way to do it is currently with m3u playlists Tutorial