{"record":{"id":"fb3a1c5df005a80b","repo":"hashicorp/nomad","slug":"invalid-check-type-q-must-be-one-of-s","errorCode":null,"errorMessage":"invalid check type (%q), must be one of %s","messagePattern":"invalid check type \\(%q\\), must be one of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/services.go","lineNumber":262,"sourceCode":"\n\t// Set task name if not already set\n\tif sc.TaskName == \"\" && taskName != \"group\" {\n\t\tsc.TaskName = taskName\n\t}\n\n\t// Ensure OnUpdate defaults to require_healthy (i.e. healthiness check)\n\tif sc.OnUpdate == \"\" {\n\t\tsc.OnUpdate = OnUpdateRequireHealthy\n\t}\n}\n\n// validateCommon validates the parts of ServiceCheck shared across providers.\nfunc (sc *ServiceCheck) validateCommon(allowableTypes []string) error {\n\t// validate the type is allowable (different between nomad, consul checks)\n\tcheckType := strings.ToLower(sc.Type)\n\tif !slices.Contains(allowableTypes, checkType) {\n\t\ts := strings.Join(allowableTypes, \", \")\n\t\treturn fmt.Errorf(`invalid check type (%q), must be one of %s`, checkType, s)\n\t}\n\n\t// validate specific check types\n\tswitch checkType {\n\tcase ServiceCheckHTTP:\n\t\tif sc.Path == \"\" {\n\t\t\treturn fmt.Errorf(\"http type must have http path\")\n\t\t}\n\t\tcheckPath, pathErr := url.Parse(sc.Path)\n\t\tif pathErr != nil {\n\t\t\treturn fmt.Errorf(\"http type must have valid http path\")\n\t\t}\n\t\tif checkPath.IsAbs() {\n\t\t\treturn fmt.Errorf(\"http type must have relative http path\")\n\t\t}\n\tcase ServiceCheckScript:\n\t\tif sc.Command == \"\" {\n\t\t\treturn fmt.Errorf(\"script type must have a valid script path\")","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/services.go#L244-L280","documentation":"ServiceCheck.validateCommon found a check `type` (case-insensitive) not in the allowable set for the provider (nomad or consul); the message lists the accepted types.","triggerScenarios":"Thrown at nomad/structs/services.go:262 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the check type to one of the listed allowable types (e.g. tcp, http, grpc, script)","Check for provider-specific type restrictions between Nomad and Consul checks"],"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"}