{"record":{"id":"bbe12251a2845838","repo":"hashicorp/nomad","slug":"on-update-value-q-not-supported-with-check-restar","errorCode":null,"errorMessage":"on_update value %q not supported with check_restart ignore_warnings value %q","messagePattern":"on_update value %q not supported with check_restart ignore_warnings value %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/services.go","lineNumber":338,"sourceCode":"\tcase \"\", OnUpdateIgnore, OnUpdateRequireHealthy, OnUpdateIgnoreWarn:\n\t\t// OK\n\tdefault:\n\t\treturn fmt.Errorf(\"on_update must be %q, %q, or %q; got %q\", OnUpdateRequireHealthy, OnUpdateIgnoreWarn, OnUpdateIgnore, sc.OnUpdate)\n\t}\n\n\t// validate check_restart and on_update do not conflict\n\tif sc.CheckRestart != nil {\n\t\t// CheckRestart and OnUpdate Ignore are incompatible If OnUpdate treats\n\t\t// an error has healthy, and the deployment succeeds followed by check\n\t\t// restart restarting failing checks, the deployment is left in an odd\n\t\t// state\n\t\tif sc.OnUpdate == OnUpdateIgnore {\n\t\t\treturn fmt.Errorf(\"on_update value %q is not compatible with check_restart\", sc.OnUpdate)\n\t\t}\n\t\t// CheckRestart IgnoreWarnings must be true if a check has defined OnUpdate\n\t\t// ignore_warnings\n\t\tif !sc.CheckRestart.IgnoreWarnings && sc.OnUpdate == OnUpdateIgnoreWarn {\n\t\t\treturn fmt.Errorf(\"on_update value %q not supported with check_restart ignore_warnings value %q\", sc.OnUpdate, strconv.FormatBool(sc.CheckRestart.IgnoreWarnings))\n\t\t}\n\t}\n\n\t// validate check_restart\n\tif err := sc.CheckRestart.Validate(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// validate a Service's ServiceCheck in the context of the Nomad provider.\nfunc (sc *ServiceCheck) validateNomad() error {\n\tallowable := []string{ServiceCheckTCP, ServiceCheckHTTP}\n\tif err := sc.validateCommon(allowable); err != nil {\n\t\treturn err\n\t}\n","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/services.go#L320-L356","documentation":"The check combines an on_update value that treats errors as healthy with check_restart.ignore_warnings enabled; validateCommon rejects the pairing because warnings-as-healthy plus restart-on-failure semantics conflict.","triggerScenarios":"Thrown at nomad/structs/services.go:338 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set ignore_warnings = false in check_restart","Use an on_update value compatible with the check_restart configuration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}