{"record":{"id":"f63208cca3ef6c2c","repo":"hashicorp/nomad","slug":"service-s-kind-must-be-one-of-consul-service-kind","errorCode":null,"errorMessage":"Service %s kind must be one of consul service kind or empty","messagePattern":"Service (.+?) kind must be one of consul service kind or empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/services.go","lineNumber":883,"sourceCode":"\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"Check %s invalid: tcp checks are not valid for Connect enabled services\", c.Name))\n\t\t\tcontinue\n\t\t}\n\n\t\t// validate the consul check\n\t\tif err := c.validateConsul(); err != nil {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"Check %s invalid: %v\", c.Name, err))\n\t\t}\n\t}\n\n\t// validate the consul service kind\n\tswitch api.ServiceKind(s.Kind) {\n\tcase api.ServiceKindTypical,\n\t\tapi.ServiceKindAPIGateway,\n\t\tapi.ServiceKindIngressGateway,\n\t\tapi.ServiceKindMeshGateway,\n\t\tapi.ServiceKindTerminatingGateway:\n\tdefault:\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"Service %s kind must be one of consul service kind or empty\", s.Name))\n\t}\n\n\t// check connect\n\tif s.Connect != nil {\n\t\tif err := s.Connect.Validate(); err != nil {\n\t\t\tmErr.Errors = append(mErr.Errors, err)\n\t\t}\n\n\t\t// if service is connect native, service task must be set (which may\n\t\t// happen implicitly in a job mutation if there is only one task)\n\t\tif s.Connect.IsNative() && len(s.TaskName) == 0 {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"Service %s is Connect Native and requires setting the task\", s.Name))\n\t\t}\n\n\t\t// if service is connect native a port must be set on the service or consul will reject it\n\t\tif s.Connect.IsNative() && s.PortLabel == \"\" {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"Service %s is Connect Native and requires setting the port\", s.Name))\n\t\t}","sourceCodeStart":865,"sourceCodeEnd":901,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/services.go#L865-L901","documentation":"validateConsulService checks that the service's `kind` field maps to a valid Consul service kind (typical, api-gateway, ingress-gateway, mesh-gateway, terminating-gateway) or is empty. Any other kind value is rejected because Consul would not accept the registration.","triggerScenarios":"Setting kind = \"connect-proxy\", \"terminating-gateway \" (typo/whitespace), or any invented kind string on a service stanza with provider = \"consul\".","commonSituations":"Hand-copying Consul catalog kinds that Nomad services don't support; typos in gateway kind names; using kinds reserved for Consul's own registrations.","solutions":["Remove the kind field (empty/typical is the default for normal services).","Use one of the supported gateway kinds: \"api-gateway\", \"ingress-gateway\", \"mesh-gateway\", or \"terminating-gateway\".","Fix the casing/spelling of the kind value."],"exampleFix":"// before\nservice {\n  name = \"ingress\"\n  kind = \"ingress_gateway\"\n  gateway { ingress { ... } }\n}\n// after\nservice {\n  name = \"ingress\"\n  kind = \"ingress-gateway\"\n  gateway { ingress { ... } }\n}","handlingStrategy":"validation","validationCode":"var validKinds = map[string]bool{\"\": true, \"typical\": true, \"api-gateway\": true, \"ingress-gateway\": true, \"mesh-gateway\": true, \"terminating-gateway\": true}\nif !validKinds[svc.Kind] { return fmt.Errorf(\"invalid kind %q\", svc.Kind) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit kind for normal services; only set it for gateway services","Copy kind values exactly from Nomad docs (hyphenated, lowercase)","Add a schema lint for allowed kind values in your job repo"],"tags":["nomad","consul","service-kind","validation"],"backgroundTag":"invalid-service-kind","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"}