{"record":{"id":"fe51147143dd8373","repo":"HangfireIO/Hangfire","slug":"misfire-option-0-is-not-supported","errorCode":null,"errorMessage":"Misfire option '{0}' is not supported.","messagePattern":"Misfire option '(.+?)' is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Hangfire.Core/RecurringJobEntity.cs","lineNumber":89,"sourceCode":"                LastExecution = JobHelper.DeserializeDateTime(lastExecution);\n            }\n\n            if (recurringJob.TryGetValue(\"NextExecution\", out var nextExecution) && !String.IsNullOrWhiteSpace(nextExecution))\n            {\n                NextExecution = JobHelper.DeserializeDateTime(nextExecution);\n            }\n\n            if (recurringJob.TryGetValue(\"CreatedAt\", out var createdAt) && !String.IsNullOrWhiteSpace(createdAt))\n            {\n                CreatedAt = JobHelper.DeserializeDateTime(createdAt);\n            }\n\n            if (recurringJob.TryGetValue(\"Misfire\", out var misfireStr))\n            {\n                MisfireHandling = (MisfireHandlingMode)Enum.Parse(typeof(MisfireHandlingMode), misfireStr);\n                if (!Enum.IsDefined(typeof(MisfireHandlingMode), MisfireHandling))\n                {\n                    throw new NotSupportedException(String.Format(CultureInfo.CurrentCulture, \"Misfire option '{0}' is not supported.\", (int)MisfireHandling));\n                }\n            }\n            else\n            {\n                MisfireHandling = MisfireHandlingMode.Relaxed;\n            }\n\n            if (recurringJob.TryGetValue(\"V\", out var version) && !String.IsNullOrWhiteSpace(version))\n            {\n                Version = int.Parse(version, CultureInfo.InvariantCulture);\n            }\n\n            if (recurringJob.TryGetValue(\"RetryAttempt\", out var attemptString) &&\n                int.TryParse(attemptString, out var retryAttempt))\n            {\n                RetryAttempt = retryAttempt;\n            }\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/HangfireIO/Hangfire/blob/c236dd0f930f831ec151e436e138ddc429a02a72/src/Hangfire.Core/RecurringJobEntity.cs#L71-L107","documentation":"Thrown when a recurring job's stored 'Misfire' field parses to an integer that is not a defined MisfireHandlingMode value (0=Relaxed, 1=Strict, 2=Ignorable). This indicates corrupt or out-of-range data in the job storage's recurring-job hash/set, since well-formed clients only write valid enum integers.","triggerScenarios":"A recurring job entry in storage contains a 'Misfire' key with a value like '3' or '-1' or a non-integer, and RecurringJobEntity constructor parses it via Enum.Parse then Enum.IsDefined fails. Triggered when the scheduler or manager reads that job from storage.","commonSituations":"Manual edits to the Hangfire storage (SQL rows, Redis keys) that set an invalid Misfire value. A custom storage implementation writing the wrong value. Downgrading Hangfire after a future version introduced new misfire modes that an older version doesn't recognize.","solutions":["Correct or remove the 'Misfire' field for the offending recurring job in storage so it is absent (defaults to Relaxed) or a valid 0/1/2.","Delete and recreate the recurring job via RecurringJob.AddOrUpdate to overwrite the corrupt entry.","If using a custom storage, ensure it persists Misfire as the integer .ToString('D') of a valid MisfireHandlingMode."],"exampleFix":"// before — storage contains: HSET recurring-job:myjob Misfire 5\n\n// after — remove the corrupt field, let Hangfire recreate it:\n// HDEL recurring-job:myjob Misfire\nRecurringJob.AddOrUpdate(\"myjob\", () => Work(), Cron.Daily());","handlingStrategy":"try-catch","validationCode":"// Before reading, check the stored Misfire is a valid enum integer\nvar raw = connection.GetJobParameter(jobId, \"Misfire\");\nif (raw != null && !int.TryParse(raw, out var m) || (m < 0 || m > 2))\n{\n    // log and reset\n}","typeGuard":null,"tryCatchPattern":"try { var job = connection.GetOrCreateRecurringJob(id); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Misfire\")) { /* repair the entry */ }","preventionTips":["Never edit Hangfire storage manually without preserving valid Misfire values (0,1,2).","When downgrading Hangfire, recreate recurring jobs so stale fields are rewritten.","Custom storages must persist Misfire as the integer .ToString(\"D\")."],"tags":["recurring-job","misfire","storage-corruption","not-supported"],"backgroundTag":null,"analyzedSha":"c236dd0f930f831ec151e436e138ddc429a02a72","analyzedAt":"2026-08-13T20:27:11.027Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}