imranmomin / Hangfire.AzureCosmosDb

Azure Cosmos DB storage provider for Hangfire
https://www.hangfire.io/
MIT License
18 stars 17 forks source link

Getting an error when accessing hangfire dashboard job categories #9

Closed saeid-p closed 2 years ago

saeid-p commented 4 years ago

When I try to view any categories under the dashboard, I'm getting a different error message. If the section has any records associated with it, it fails to load.

Preview

E.g., the following error message shows up when I try to look at the "Succeeded" section.

{
  "message": "The given key 'SucceededAt' was not present in the dictionary.",
  "Trace": "System.Collections.Generic.KeyNotFoundException: The given key 'SucceededAt' was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
  at Hangfire.Azure.CosmosDbMonitoringApi.<>c.<SucceededJobs>b__14_0(State state, Job job)
  at Hangfire.Azure.CosmosDbMonitoringApi.<>c__DisplayClass17_0`1.<GetJobsOnState>b__4(Job job)
  at System.Collections.Generic.List`1.ForEach(Action`1 action)   
  at Hangfire.Azure.CosmosDbMonitoringApi.GetJobsOnState[T](String stateName, Int32 from, Int32 count, Func`3 selector)   
  at Hangfire.Azure.CosmosDbMonitoringApi.SucceededJobs(Int32 from, Int32 count)   
  at Hangfire.Dashboard.Pages.SucceededJobs.Execute()   
  at Hangfire.Dashboard.RazorPage.TransformText(String body)   
  at Hangfire.Dashboard.RazorPageDispatcher.Dispatch(DashboardContext context)   
  at Hangfire.Dashboard.AspNetCoreDashboardMiddleware.Invoke(HttpContext httpContext)   
  at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)   
  at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)   
  at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)   
  at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)   
  at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)   
  at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)   
  at Microsoft.AspNetCore.ResponseCaching.ResponseCachingMiddleware.Invoke(HttpContext httpContext)   
  at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)   
  at Cavu.Api.Extensions.HandleApiErrorMiddleware.InvokeAsync(HttpContext context)"
}
Messan commented 3 years ago

Hello,

Any news about this issue ? I have checked the data in the CosmosDb it seems this is related to some orphaned records

Regards,