HangfireIO / HangfireIO/Hangfire

was not recognized as a valid DateTime. at System.DateTimeParse.Parse(ReadOnlySpan1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles)

Open
#2,135 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

1
System.FormatException: String ''">eval(atob("REDACTED"))' was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(ReadOnlySpan1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.DateTime.Parse(String s, IFormatProvider provider, DateTimeStyles styles) at Hangfire.Common.JobHelper.DeserializeDateTime(String value) at Hangfire.RecurringJobEntity..ctor(String recurringJobId, IDictionary2 recurringJob, ITimeZoneResolver timeZoneResolver, DateTime now)
at Hangfire.RecurringJobExtensions.GetRecurringJob(IStorageConnection connection, String recurringJobId, ITimeZoneResolver timeZoneResolver, DateTime now)
at Hangfire.Server.RecurringJobScheduler.TryEnqueueBackgroundJob(BackgroundProcessContext context, IStorageConnection connection, String recurringJobId, DateTime now)
at Hangfire.Server.RecurringJobScheduler.<>c__DisplayClass18_0.b__0(IStorageConnection connection)
at Hangfire.Server.RecurringJobScheduler.UseConnectionDistributedLock[T](JobStorage storage, Func2 action) at Hangfire.Server.RecurringJobScheduler.EnqueueNextRecurringJobs(BackgroundProcessContext context) at Hangfire.Server.RecurringJobScheduler.Execute(BackgroundProcessContext context) at Hangfire.Server.BackgroundProcessDispatcherBuilder.ExecuteProcess(Guid executionId, Object state) at Hangfire.Processing.BackgroundExecution.Run(Action2 callback, Object state)

2
: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HMM8KB6083SV", Request id "0HMM8KB6083SV:0000000B": An unhandled exception was thrown by the application.
Newtonsoft.Json.JsonReaderException: Unterminated string. Expected delimiter: '. Path '', line 1, position 636.
at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote)
at Newtonsoft.Json.JsonTextReader.ParseString(Char quote, ReadType readType)
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Hangfire.Common.SerializationHelper.Deserialize(String value, Type type, SerializationOption option)
--- End of stack trace from previous location ---
at Hangfire.Common.SerializationHelper.Deserialize(String value, Type type, SerializationOption option)
at Hangfire.Common.SerializationHelper.Deserialize[T](String value, SerializationOption option)
at Hangfire.Common.SerializationHelper.Deserialize[T](String value)
at Hangfire.Storage.InvocationData.DeserializePayload(String payload)
at Hangfire.Storage.StorageConnectionExtensions.GetRecurringJobDtos(IStorageConnection connection, IEnumerable1 ids) at Hangfire.Storage.StorageConnectionExtensions.GetRecurringJobs(JobStorageConnection connection, Int32 startingFrom, Int32 endingAt) at Hangfire.Dashboard.Pages.RecurringJobsPage.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 Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.WebTools.BrowserLink.Net.BrowserLinkMiddleware.ExecuteWithFilterAsync(IHttpSocketAdapter injectScriptSocket, String requestId, HttpContext httpContext) at Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(HttpContext context) at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application)

3
http://127.0.0.1:9999/job/recurring Cannot be opened!!!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure through the recurring jobs dashboard at /job/recurring, then trace the reported entry points: JobHelper.DeserializeDateTime, RecurringJobEntity, SerializationHelper.Deserialize, and InvocationData.DeserializePayload. Compare the recurring-job data involved in both stack traces and determine what behavior should be preserved or reported when it cannot be parsed; done means the recurring jobs page and scheduler handle the malformed data without these unhandled exceptions.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.