Ombi icon indicating copy to clipboard operation
Ombi copied to clipboard

"Unhandled exception. System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds" - ombi not loading after upgrade - windows

Open mastertIT opened this issue 3 years ago • 13 comments

Describe the bug

when upgrading to the latest version ombi doesn't load, regardless of loading the localhost:5000 or via reverse proxy.

To Reproduce Steps to reproduce the behavior:

  1. Upgrade to version 4.24 / 4.25

Expected behavior A clear and concise description of what you expected to happen. Ombi webpage loading.

Logs (Logs directory where Ombi is located)

If applicable, a snippet of the logs that seems relevant to the bug if present.
when running ombi via command line:
Wrote new baseurl at C:\Users\Administrator\AppData\Local\OMBI\ClientApp\dist\index.html
Total Requests to migrate 83
Unhandled exception. System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
 ---> System.TimeoutException: A task was canceled.
 ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Ombi.Api.Api.Request[T](Request request, CancellationToken cancellationToken) in /home/runner/work/Ombi/Ombi/src/Ombi.Api/Api.cs:line 40
   at Ombi.Api.TheMovieDb.TheMovieDbApi.Find(String externalId, ExternalSource source) in /home/runner/work/Ombi/Ombi/src/Ombi.TheMovieDbApi/TheMovieDbApi.cs:line 120
   at Ombi.Program.MigrateOldTvDbIds(OmbiContext ctx, GlobalSettings ombiSettingsContent, SettingsContext settingsContext, TheMovieDbApi api) in /home/runner/work/Ombi/Ombi/src/Ombi/Program.cs:line 311
   at Ombi.Program.Main(String[] args) in /home/runner/work/Ombi/Ombi/src/Ombi/Program.cs:line 138
   at Ombi.Program.<Main>(String[] args)
PS C:\Users\Administrator\AppData\Local\OMBI>

Desktop (please complete the following information):

  • OS: Windows Server 2019

Ombi Version (please complete the following information):

  • Version 4.25
  • Media Server Plex
  • Database Type: SQLite

Additional context Add any other context about the problem here.

mastertIT avatar Aug 27 '22 23:08 mastertIT

Hi!
Thanks for the issue report. Before a real human comes by, please make sure you used our bug report format.
Have you looked at the wiki yet? https://docs.ombi.app/
Before posting make sure you also read our FAQ.
Make the title describe your issue. Having 'not working' or 'I get this bug' for 100 issues, isn't really helpful.
If we need more information or there is some progress we tag the issue or update the tag and keep you updated.
Thanks!
Ombi Bot.

github-actions[bot] avatar Aug 27 '22 23:08 github-actions[bot]

Your logs mention that there’s timeouts attempting to connect to TheMovieDb API. Check firewall and ensure you can access it etc

tidusjar avatar Aug 28 '22 06:08 tidusjar

yes i have had issues with accessing the trending on the homepage of ombi prior to upgrading ombi (the reasoning to do so etc.)

however, even with it failing would that terminate the program? thats the symptoms i'm facing now.

i am able to access the movie db site. as well as load results by accessing https://api.themoviedb.org/3/movie/76341 etc.

mastertIT avatar Aug 28 '22 18:08 mastertIT

https://i.postimg.cc/brvjj2n3/image.png see attached screenshot showing API and tmdb working along with the error.

not sure what else to check as the error doesn't point to anything specific.

mastertIT avatar Sep 02 '22 02:09 mastertIT

And that’s from the same machine as Ombi is running on?

tidusjar avatar Sep 02 '22 07:09 tidusjar

Yes.

mastertIT avatar Sep 02 '22 13:09 mastertIT

are there any more verbose logs to determine why this issue is occurring?

could this be a permissions issue? i cannot find any evidence as to the cause especially if access to tmdb is possible from the same server that ombi is running from.

mastertIT avatar Sep 08 '22 22:09 mastertIT

@tidusjar i've determined that the issue is due to some sort of issue in one of the tables. as when the db is recreated the error disappears.

however i have not be able to determine which table or row is causing the error. nothing in the Settings or Ombi databases seem to lead to any answer.

mastertIT avatar Sep 18 '22 07:09 mastertIT

prior to this issue surfacing the symptoms were the homepage of ombi would not load the trending sources, and searches would load continously and never have any results.

the log that shows up while this occurs is below:


fail: Ombi.ErrorHandlingMiddleware[0]
      Something bad happened, ErrorMiddleware caught this
      System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
       ---> System.TimeoutException: A task was canceled.
       ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
         at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
         at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
         --- End of inner exception stack trace ---
         --- End of inner exception stack trace ---
         at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
         at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
         at Ombi.Api.Api.Request[T](Request request, CancellationToken cancellationToken) in /home/runner/work/Ombi/Ombi/src/Ombi.Api/Api.cs:line 90
         at Ombi.Api.TheMovieDb.TheMovieDbApi.GetTVInfo(String themoviedbid, String langCode) in /home/runner/work/Ombi/Ombi/src/Ombi.TheMovieDbApi/TheMovieDbApi.cs:line 400
         at Ombi.Core.Engine.V2.TvSearchEngineV2.<>c__DisplayClass16_0.<<ProcessResults>b__0>d.MoveNext() in /home/runner/work/Ombi/Ombi/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs:line 239
      --- End of stack trace from previous location ---
         at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func`2 factory)
         at Ombi.Helpers.CacheService.GetOrAddAsync[T](String cacheKey, Func`1 factory, DateTimeOffset absoluteExpiration) in /home/runner/work/Ombi/Ombi/src/Ombi.Helpers/CacheService.cs:line 29
         at Ombi.Core.Engine.V2.TvSearchEngineV2.ProcessResults(List`1 items) in /home/runner/work/Ombi/Ombi/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs:line 238
         at Ombi.Core.Engine.V2.TvSearchEngineV2.Anticipated(Int32 currentlyLoaded, Int32 amountToLoad) in /home/runner/work/Ombi/Ombi/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs:line 135
         at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func`2 factory)
         at Ombi.Helpers.MediaCacheService.GetOrAddAsync[T](String cacheKey, Func`1 factory, DateTimeOffset absoluteExpiration) in /home/runner/work/Ombi/Ombi/src/Ombi.Helpers/MediaCacheService.cs:line 42
         at lambda_method842(Closure , Object )
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.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|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 Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
         at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
         at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
         at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Ombi.ApiKeyMiddlewear.ValidateUserAccessToken(HttpContext context, RequestDelegate next, String key) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ApiKeyMiddlewear.cs:line 84
         at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ApiKeyMiddlewear.cs:line 58
         at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ErrorHandlingMiddlewear.cs:line 30
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HMKVCT2EMQCS", Request id "0HMKVCT2EMQCS:00000003": An unhandled exception was thrown by the application.
      System.InvalidOperationException: Writing to the response body is invalid for responses with status code 204.
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Advance(Int32 bytes)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponsePipeWriter.Advance(Int32 bytes)
         at Microsoft.AspNetCore.Http.HttpResponseWritingExtensions.Write(HttpResponse response, String text, Encoding encoding)
         at Microsoft.AspNetCore.Http.HttpResponseWritingExtensions.WriteAsync(HttpResponse response, String text, Encoding encoding, CancellationToken cancellationToken)
         at Microsoft.AspNetCore.Http.HttpResponseWritingExtensions.WriteAsync(HttpResponse response, String text, CancellationToken cancellationToken)
         at Ombi.ErrorHandlingMiddleware.HandleExceptionAsync(HttpContext context, Exception exception) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ErrorHandlingMiddlewear.cs:line 53
         at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ErrorHandlingMiddlewear.cs:line 30
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
fail: Ombi.ErrorHandlingMiddleware[0]
      Something bad happened, ErrorMiddleware caught this
      System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
       ---> System.TimeoutException: A task was canceled.
       ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
         at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
         at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
         --- End of inner exception stack trace ---
         --- End of inner exception stack trace ---
         at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
         at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
         at Ombi.Api.Api.Request[T](Request request, CancellationToken cancellationToken) in /home/runner/work/Ombi/Ombi/src/Ombi.Api/Api.cs:line 90
         at Ombi.Api.TheMovieDb.TheMovieDbApi.GetTVInfo(String themoviedbid, String langCode) in /home/runner/work/Ombi/Ombi/src/Ombi.TheMovieDbApi/TheMovieDbApi.cs:line 400
         at Ombi.Core.Engine.V2.TvSearchEngineV2.<>c__DisplayClass16_0.<<ProcessResults>b__0>d.MoveNext() in /home/runner/work/Ombi/Ombi/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs:line 239
      --- End of stack trace from previous location ---
         at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func`2 factory)
         at Ombi.Helpers.CacheService.GetOrAddAsync[T](String cacheKey, Func`1 factory, DateTimeOffset absoluteExpiration) in /home/runner/work/Ombi/Ombi/src/Ombi.Helpers/CacheService.cs:line 29
         at Ombi.Core.Engine.V2.TvSearchEngineV2.ProcessResults(List`1 items) in /home/runner/work/Ombi/Ombi/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs:line 238
         at Ombi.Core.Engine.V2.TvSearchEngineV2.Trending(Int32 currentlyLoaded, Int32 amountToLoad) in /home/runner/work/Ombi/Ombi/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs:line 156
         at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func`2 factory)
         at Ombi.Helpers.MediaCacheService.GetOrAddAsync[T](String cacheKey, Func`1 factory, DateTimeOffset absoluteExpiration) in /home/runner/work/Ombi/Ombi/src/Ombi.Helpers/MediaCacheService.cs:line 42
         at lambda_method876(Closure , Object )
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.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|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 Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
         at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
         at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
         at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Ombi.ApiKeyMiddlewear.ValidateUserAccessToken(HttpContext context, RequestDelegate next, String key) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ApiKeyMiddlewear.cs:line 84
         at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ApiKeyMiddlewear.cs:line 58
         at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ErrorHandlingMiddlewear.cs:line 30
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HMKVCT2EMQCP", Request id "0HMKVCT2EMQCP:00000002": An unhandled exception was thrown by the application.
      System.InvalidOperationException: Writing to the response body is invalid for responses with status code 204.
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Advance(Int32 bytes)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponsePipeWriter.Advance(Int32 bytes)
         at Microsoft.AspNetCore.Http.HttpResponseWritingExtensions.Write(HttpResponse response, String text, Encoding encoding)
         at Microsoft.AspNetCore.Http.HttpResponseWritingExtensions.WriteAsync(HttpResponse response, String text, Encoding encoding, CancellationToken cancellationToken)
         at Microsoft.AspNetCore.Http.HttpResponseWritingExtensions.WriteAsync(HttpResponse response, String text, CancellationToken cancellationToken)
         at Ombi.ErrorHandlingMiddleware.HandleExceptionAsync(HttpContext context, Exception exception) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ErrorHandlingMiddlewear.cs:line 53
         at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ErrorHandlingMiddlewear.cs:line 30
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
fail: Ombi.ErrorHandlingMiddleware[0]
      Something bad happened, ErrorMiddleware caught this
      System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
       ---> System.TimeoutException: A task was canceled.
       ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
         at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
         at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
         --- End of inner exception stack trace ---
         --- End of inner exception stack trace ---
         at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
         at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
         at Ombi.Api.Api.Request[T](Request request, CancellationToken cancellationToken) in /home/runner/work/Ombi/Ombi/src/Ombi.Api/Api.cs:line 90
         at Ombi.Api.TheMovieDb.TheMovieDbApi.GetTVInfo(String themoviedbid, String langCode) in /home/runner/work/Ombi/Ombi/src/Ombi.TheMovieDbApi/TheMovieDbApi.cs:line 400
         at Ombi.Core.Engine.V2.TvSearchEngineV2.<>c__DisplayClass16_0.<<ProcessResults>b__0>d.MoveNext() in /home/runner/work/Ombi/Ombi/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs:line 239
      --- End of stack trace from previous location ---
         at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func`2 factory)
         at Ombi.Helpers.CacheService.GetOrAddAsync[T](String cacheKey, Func`1 factory, DateTimeOffset absoluteExpiration) in /home/runner/work/Ombi/Ombi/src/Ombi.Helpers/CacheService.cs:line 29
         at Ombi.Core.Engine.V2.TvSearchEngineV2.ProcessResults(List`1 items) in /home/runner/work/Ombi/Ombi/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs:line 238
         at Ombi.Core.Engine.V2.TvSearchEngineV2.Popular(Int32 currentlyLoaded, Int32 amountToLoad, String langCustomCode) in /home/runner/work/Ombi/Ombi/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs:line 119
         at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func`2 factory)
         at Ombi.Helpers.MediaCacheService.GetOrAddAsync[T](String cacheKey, Func`1 factory, DateTimeOffset absoluteExpiration) in /home/runner/work/Ombi/Ombi/src/Ombi.Helpers/MediaCacheService.cs:line 42
         at lambda_method986(Closure , Object )
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.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|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 Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
         at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
         at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
         at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Ombi.ApiKeyMiddlewear.ValidateUserAccessToken(HttpContext context, RequestDelegate next, String key) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ApiKeyMiddlewear.cs:line 84
         at Ombi.ApiKeyMiddlewear.Invoke(HttpContext context) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ApiKeyMiddlewear.cs:line 58
         at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ErrorHandlingMiddlewear.cs:line 30
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HMKVCT2EMQCQ", Request id "0HMKVCT2EMQCQ:00000002": An unhandled exception was thrown by the application.
      System.InvalidOperationException: Writing to the response body is invalid for responses with status code 204.
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Advance(Int32 bytes)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponsePipeWriter.Advance(Int32 bytes)
         at Microsoft.AspNetCore.Http.HttpResponseWritingExtensions.Write(HttpResponse response, String text, Encoding encoding)
         at Microsoft.AspNetCore.Http.HttpResponseWritingExtensions.WriteAsync(HttpResponse response, String text, Encoding encoding, CancellationToken cancellationToken)
         at Microsoft.AspNetCore.Http.HttpResponseWritingExtensions.WriteAsync(HttpResponse response, String text, CancellationToken cancellationToken)
         at Ombi.ErrorHandlingMiddleware.HandleExceptionAsync(HttpContext context, Exception exception) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ErrorHandlingMiddlewear.cs:line 53
         at Ombi.ErrorHandlingMiddleware.Invoke(HttpContext context) in /home/runner/work/Ombi/Ombi/src/Ombi/Middleware/ErrorHandlingMiddlewear.cs:line 30
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

mastertIT avatar Sep 26 '22 03:09 mastertIT

I'm also having this error. While ombi still loads, nothing from the themoviedb loads in the interface. I have checked my firewall and can confirm that my machine can access api.themoviedb.org

If I restart ombi enough times, the problem goes a way for a bit before happening again.

Running: docker in ubuntu

brandon-daniels avatar Dec 27 '22 19:12 brandon-daniels

Edit: Removing from this thread to post in a new issue, in the interest of avoiding any dramatics associated with this thread.

goose-ws avatar Mar 24 '23 19:03 goose-ws

I deleted your comment as it was not useful at all to the thread

tidusjar avatar Mar 25 '23 00:03 tidusjar

Perhaps you should try and solve the bug then.

mastertIT avatar Mar 25 '23 01:03 mastertIT