{"record":{"id":"a1e5139453cf07f0","repo":"hashicorp/nomad","slug":"on-update-may-only-be-set-to-ignore-warnings-for-c","errorCode":null,"errorMessage":"on_update may only be set to ignore_warnings for Consul service checks","messagePattern":"on_update may only be set to ignore_warnings for Consul service checks","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/services.go","lineNumber":364,"sourceCode":"\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\n\t// expose is connect (consul) specific\n\tif sc.Expose {\n\t\treturn errors.New(\"expose may only be set for Consul service checks\")\n\t}\n\n\t// nomad checks do not have warnings\n\tif sc.OnUpdate == OnUpdateIgnoreWarn {\n\t\treturn errors.New(\"on_update may only be set to ignore_warnings for Consul service checks\")\n\t}\n\n\t// below are temporary limitations on checks in nomad\n\t// https://github.com/hashicorp/team-nomad/issues/354\n\n\t// check_restart.ignore_warnings is not a thing in Nomad (which has no warnings in checks)\n\tif sc.CheckRestart != nil {\n\t\tif sc.CheckRestart.IgnoreWarnings {\n\t\t\treturn errors.New(\"ignore_warnings on check_restart only supported for Consul service checks\")\n\t\t}\n\t}\n\n\t// address_mode=\"driver\" not yet supported on nomad\n\tif sc.AddressMode == \"driver\" {\n\t\treturn errors.New(\"address_mode = driver may only be set for Consul service checks\")\n\t}\n\n\tif sc.Type == \"http\" {","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/services.go#L346-L382","documentation":"Nomad service checks never produce 'warning' states, so on_update = \"ignore_warnings\" is meaningless for them and validateNomad rejects it. That on_update value is only valid for Consul service checks where checks can report warnings.","triggerScenarios":"A check on a non-Consul (nomad provider) service sets on_update = \"ignore_warnings\".","commonSituations":"Copying update-block settings from Consul-backed services to nomad services; misunderstanding that ignore_warnings applies to check_restart semantics only under Consul.","solutions":["Remove on_update = \"ignore_warnings\" from the check","Use a supported on_update value (e.g. ignore) or omit it for nomad checks","Move the service to provider = \"consul\" if ignore_warnings behavior is required"],"exampleFix":"// before\ncheck {\n  on_update = \"ignore_warnings\"\n}\n// after\ncheck {\n  on_update = \"ignore\"\n}","handlingStrategy":"validation","validationCode":"if check.OnUpdate == \"ignore_warnings\" && service.Provider != \"consul\" {\n    return fmt.Errorf(\"check %q: on_update=ignore_warnings requires consul provider\", check.Name)\n}","typeGuard":null,"tryCatchPattern":"if err := job.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"on_update may only be set to ignore_warnings\") {\n        // change on_update or remove it\n    }\n}","preventionTips":["Restrict on_update=ignore_warnings to Consul service checks","Keep shared check templates split per provider","Validate jobs before submit"],"tags":["nomad","consul","service-check","validation"],"backgroundTag":"unsupported-check-option","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"}