{"record":{"id":"915165074196a85c","repo":"hashicorp/nomad","slug":"reconcile-option-is-invalid","errorCode":null,"errorMessage":"reconcile option is invalid","messagePattern":"reconcile option is invalid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/group.go","lineNumber":30,"sourceCode":")\n\nconst (\n\t// ReconcileOption is used to specify the behavior of the reconciliation process\n\t// between the original allocations and the replacements when a previously\n\t// disconnected client comes back online.\n\tReconcileOptionKeepOriginal    = \"keep_original\"\n\tReconcileOptionKeepReplacement = \"keep_replacement\"\n\tReconcileOptionBestScore       = \"best_score\"\n\tReconcileOptionLongestRunning  = \"longest_running\"\n)\n\nvar (\n\t// Disconnect strategy validation errors\n\terrStopAndLost         = errors.New(\"Disconnect cannot be configured with both lost_after and stop_after\")\n\terrNegativeLostAfter   = errors.New(\"lost_after cannot be a negative duration\")\n\terrNegativeStopAfter   = errors.New(\"stop_after cannot be a negative duration\")\n\terrStopAfterNonService = errors.New(\"stop_after can only be used with service or batch job types\")\n\terrInvalidReconcile    = errors.New(\"reconcile option is invalid\")\n)\n\nfunc NewDefaultDisconnectStrategy() *DisconnectStrategy {\n\treturn &DisconnectStrategy{\n\t\tReplace:   new(true),\n\t\tReconcile: ReconcileOptionBestScore,\n\t}\n}\n\n// Disconnect strategy defines how both clients and server should behave in case of\n// disconnection between them.\ntype DisconnectStrategy struct {\n\t// Defines for how long the server will consider the unresponsive node as\n\t// disconnected but alive instead of lost.\n\tLostAfter time.Duration `mapstructure:\"lost_after\" hcl:\"lost_after,optional\"`\n\n\t// Defines for how long a disconnected client will keep its allocations running.\n\t// This option has a different behavior for nil, the default, and time.Duration(0),","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/group.go#L12-L48","documentation":"The DisconnectStrategy.Reconcile field must be one of the known reconcile options (e.g. ReconcileOptionBestScore, ReconcileOptionKeepOriginal, ReconcileOptionKeepReplacement). Job.Validate wraps errInvalidReconcile with the offending value via fmt.Errorf(\"%w: %s\") when the value is outside the accepted set. This guards against typo'd or unsupported reconcile strings.","triggerScenarios":"Job submission where disconnect.strategy reconcile = <value> is not one of the enumerated ReconcileOption constants; hit in Job.Validate's switch at group.go:95 default branch.","commonSituations":"Typos like reconcile = \"keep-origional\" or \"best-score\" vs the exact enum; copying config from docs of a newer Nomad version that added a reconcile option not present in the deployed binary.","solutions":["Set reconcile to a valid option: one of the documented constants (e.g. best_score, keep_original, keep_replacement)","Read the wrapped message to see the invalid value supplied and correct the spelling/enum name","Check the deployed Nomad version's supported reconcile options — newer options fail validation on older servers","Omit the reconcile field entirely to get the default (ReconcileOptionBestScore)"],"exampleFix":"# before\njob \"web\" {\n  type = \"service\"\n  disconnect {\n    reconcile = \"keep-original\"  # invalid value\n  }\n}\n\n# after\njob \"web\" {\n  type = \"service\"\n  disconnect {\n    reconcile = \"keep_original\"\n  }\n}","handlingStrategy":"validation","validationCode":"var validReconcile = map[string]bool{\"best_score\": true, \"keep_original\": true, \"keep_replacement\": true}\nif ds != nil && !validReconcile[ds.Reconcile] {\n\treturn fmt.Errorf(\"invalid reconcile option: %s\", ds.Reconcile)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use documented reconcile option constants","Re-validate specs when upgrading Nomad versions","Copy config snippets from version-matched docs"],"tags":["nomad","job-validation","disconnect-strategy","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}