{"record":{"id":"43b0199e80c2c204","repo":"hashicorp/nomad","slug":"ignore-warnings-on-check-restart-only-supported-fo","errorCode":null,"errorMessage":"ignore_warnings on check_restart only supported for Consul service checks","messagePattern":"ignore_warnings on check_restart only supported for Consul service checks","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/services.go","lineNumber":373,"sourceCode":"\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\" {\n\t\tif sc.Method != \"\" && !helper.IsMethodHTTP(sc.Method) {\n\t\t\treturn fmt.Errorf(\"method type %q not supported in Nomad http check\", sc.Method)\n\t\t}\n\t}\n\n\t// success_before_passing is consul only\n\tif sc.SuccessBeforePassing != 0 {\n\t\treturn errors.New(\"success_before_passing may only be set for Consul service checks\")\n\t}","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/services.go#L355-L391","documentation":"check_restart.ignore_warnings suppresses restarts on warning states, which only exist for Consul checks; Nomad checks have no warning state, so validateNomad rejects the setting as a temporary limitation (hashicorp/team-nomad#354).","triggerScenarios":"Defining a check_restart block with ignore_warnings = true on a check of a non-Consul service.","commonSituations":"Shared update stanza templates applied to both consul and nomad services; following Consul-oriented docs while using nomad service discovery.","solutions":["Remove ignore_warnings from the check_restart block","Keep check_restart but omit ignore_warnings for nomad checks","Use a Consul service provider if ignore_warnings is required"],"exampleFix":"// before\ncheck_restart {\n  ignore_warnings = true\n}\n// after\ncheck_restart {\n  limit = 3\n}","handlingStrategy":"validation","validationCode":"if check.CheckRestart != nil && check.CheckRestart.IgnoreWarnings && service.Provider != \"consul\" {\n    return fmt.Errorf(\"check %q: check_restart.ignore_warnings requires consul provider\", check.Name)\n}","typeGuard":null,"tryCatchPattern":"if err := job.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"ignore_warnings on check_restart\") {\n        // drop ignore_warnings from check_restart\n    }\n}","preventionTips":["Avoid ignore_warnings in templated update/check_restart blocks","Track Nomad docs for when the temporary limitation lifts","Run nomad job validate in CI"],"tags":["nomad","consul","check-restart","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"}