{"record":{"id":"95bd004355c23e08","repo":"hashicorp/nomad","slug":"connect-proxy-sidecar-task-exists-but-no-services","errorCode":null,"errorMessage":"connect proxy sidecar task exists but no services configured with a sidecar","messagePattern":"connect proxy sidecar task exists but no services configured with a sidecar","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/taskrunner/envoy_bootstrap_hook.go","lineNumber":251,"sourceCode":"\n\treturn serviceKind, serviceName, nil\n}\n\nfunc (h *envoyBootstrapHook) lookupService(svcKind, svcName string, taskEnv *taskenv.TaskEnv) (*structs.Service, error) {\n\ttg := h.alloc.Job.LookupTaskGroup(h.alloc.TaskGroup)\n\tinterpolatedServices := taskenv.InterpolateServices(taskEnv, tg.Services)\n\n\tvar service *structs.Service\n\tfor _, s := range interpolatedServices {\n\t\tif s.Name == svcName {\n\t\t\tservice = s\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif service == nil {\n\t\tif svcKind == structs.ConnectProxyPrefix {\n\t\t\treturn nil, errors.New(\"connect proxy sidecar task exists but no services configured with a sidecar\")\n\t\t} else {\n\t\t\treturn nil, errors.New(\"connect gateway task exists but no service associated\")\n\t\t}\n\t}\n\n\treturn service, nil\n}\n\n// Prestart creates an envoy bootstrap config file.\n//\n// Must be aware of both launching envoy as a sidecar proxy, as well as a connect gateway.\nfunc (h *envoyBootstrapHook) Prestart(ctx context.Context, req *ifs.TaskPrestartRequest, resp *ifs.TaskPrestartResponse) error {\n\tif !req.Task.Kind.IsConnectProxy() && !req.Task.Kind.IsAnyConnectGateway() {\n\t\treturn nil\n\t}\n\n\tserviceKind, serviceName, err := h.extractNameAndKind(req.Task.Kind)\n\tif err != nil {","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/taskrunner/envoy_bootstrap_hook.go#L233-L269","documentation":"Fired in envoyBootstrapHook.lookupService during Prestart: a connect-proxy task exists in the task group, but no service in that group matches the proxy's service name (i.e. no service declares a sidecar proxy for it).","triggerScenarios":"Thrown at client/allocrunner/taskrunner/envoy_bootstrap_hook.go:251 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a service block with connect { sidecar_service {} } to the task group so the proxy has a matching service","Fix the proxy task's service name so it matches an existing group service"],"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"}