{"record":{"id":"15fafd9470519193","repo":"hashicorp/nomad","slug":"no-connect-services-in-task-group-with-connect-pro","errorCode":null,"errorMessage":"No Connect services in task group with Connect proxy (%q)","messagePattern":"No Connect services in task group with Connect proxy \\(%q\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":8786,"sourceCode":"\tnames := make([]string, 0, len(tgServices))\n\tfor _, svc := range tgServices {\n\t\tif svc.Connect == nil || svc.Connect.SidecarService == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif svc.Name == serviceName {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\n\t\t// Build up list of mismatched Connect service names for error\n\t\t// reporting.\n\t\tnames = append(names, svc.Name)\n\t}\n\n\tif !found {\n\t\tif len(names) == 0 {\n\t\t\treturn fmt.Errorf(\"No Connect services in task group with Connect proxy (%q)\", serviceName)\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"Connect proxy service name (%q) not found in Connect services from task group: %s\", serviceName, names)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nconst (\n\t// TemplateChangeModeNoop marks that no action should be taken if the\n\t// template is re-rendered\n\tTemplateChangeModeNoop = \"noop\"\n\n\t// TemplateChangeModeSignal marks that the task should be signaled if the\n\t// template is re-rendered\n\tTemplateChangeModeSignal = \"signal\"\n\n\t// TemplateChangeModeRestart marks that the task should be restarted if the","sourceCodeStart":8768,"sourceCodeEnd":8804,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L8768-L8804","documentation":"Validation error from group service validation for Consul Connect proxies: the group declares a connect sidecar_service (proxy) whose service name does not match any Connect-enabled service in the task group, and the group has no Connect services at all. The check builds the list of Connect service names and, when the proxy's target is not found and that list is empty, returns this error.","triggerScenarios":"Submitting a job whose service stanza has connect { sidecar_service {} } (or a sidecar_service referencing a name) while the group contains no service with a `connect` block. Triggered when `found == false` and `len(names) == 0` in the proxy-name validation routine.","commonSituations":"Adding a sidecar_service stanza without defining the actual Connect-enabled service; deleting the app service but leaving the proxy; copying a proxy stanza into a group that lacks Connect services.","solutions":["Add the Connect-enabled service the proxy should attach to: service { name = \"...\"; connect { sidecar_service {} } }.","Remove the orphaned sidecar_service/proxy stanza if it is not needed.","Verify the proxy's target service name (if set in sidecar_service proxy stanza) matches an existing Connect service."],"exampleFix":"// before\nservice {\n  name = \"web-proxy\"\n  connect { sidecar_service {} }\n}\n// (no Connect service \"web\" defined)\n\n// after\nservice {\n  name = \"web\"\n  port = \"http\"\n  connect { sidecar_service {} }\n}","handlingStrategy":"validation","validationCode":"// Before submit: group must contain at least one service with a connect block\nif !slices.ContainsFunc(group.Services, func(s Service) bool { return s.Connect != nil }) {\n  return errors.New(\"sidecar_service requires a Connect service in the same group\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Place sidecar_service inside the same service stanza that has the connect block.","Never create standalone proxy-only service stanzas.","Validate connect jobs with `nomad job validate` in CI."],"tags":["nomad","consul-connect","service-mesh","validation"],"backgroundTag":"connect-proxy-misconfiguration","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"}