HangfireIO / HangfireIO/Hangfire

Unexpected end of request content.

Open
#2,234 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

When I open the dashboard, sometimes the logger writes an error:

Connection ID "0HMRT6GP3DO54", Request ID "0HMRT6GP3DO54:0000006D": The application threw an unhandled exception.

Enrich:

  • ConnectionId: 0HMRT6GP3DO54
  • EnvironmentName: Prod
  • EventId: {Id: 13, Name: 'ApplicationError'}
  • RequestId: 0HMRT6GP3DO54:0000006D
  • RequestPath: /hangfire/stats
  • SourceContext: Microsoft.AspNetCore.Server.Kestrel
  • TraceIdentifier: 0HMRT6GP3DO54:0000006D

Trace:
Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Unexpected end of request content. at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1ContentLengthMessageBody.ReadAsyncInternal(CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at Microsoft.AspNetCore.WebUtilities.FormPipeReader.ReadFormAsync(CancellationToken cancellationToken) at Microsoft.AspNetCore.Http.Features.FormFeature.InnerReadFormAsync(CancellationToken cancellationToken) at Hangfire.Dashboard.AspNetCoreDashboardRequest.GetFormValuesAsync(String key) at Hangfire.Dashboard.JsonStats.Dispatch(DashboardContext context) at Hangfire.Dashboard.AspNetCoreDashboardMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application)
`
Versions
Language Version: C# 11
Target framework: net7.0
Hangfire 1.7.32
Hangfire.Core 1.7.32
Hangfire.AspNetCore 1.7.32

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the /hangfire/stats request path and read Hangfire.Dashboard.JsonStats, AspNetCoreDashboardRequest.GetFormValuesAsync, and the ASP.NET Core dashboard middleware named in the trace. Investigate when the form body is incomplete and determine how the dashboard should handle that condition. Done means the intermittent error is reproducible or explained and the request no longer produces an unhandled exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.