hashicorp/nomad · error
envoy must be configured with a service name
Error message
envoy must be configured with a service name
What it means
Fired in envoyBootstrapHook.extractNameAndKind during Prestart when a task kind is a valid connect kind (connect sidecar or gateway) but its value — the service name — is empty, e.g. a connect sidecar task declared without an interpolated/empty service name.
Source
Thrown at client/allocrunner/taskrunner/envoy_bootstrap_hook.go:231
case structs.ConnectTerminatingPrefix:
return true
case structs.ConnectMeshPrefix:
return true
default:
return false
}
}
func (_ *envoyBootstrapHook) extractNameAndKind(kind structs.TaskKind) (string, string, error) {
serviceName := kind.Value()
serviceKind := kind.Name()
if !isConnectKind(serviceKind) {
return "", "", errors.New("envoy must be used as connect sidecar or gateway")
}
if serviceName == "" {
return "", "", errors.New("envoy must be configured with a service name")
}
return serviceKind, serviceName, nil
}
func (h *envoyBootstrapHook) lookupService(svcKind, svcName string, taskEnv *taskenv.TaskEnv) (*structs.Service, error) {
tg := h.alloc.Job.LookupTaskGroup(h.alloc.TaskGroup)
interpolatedServices := taskenv.InterpolateServices(taskEnv, tg.Services)
var service *structs.Service
for _, s := range interpolatedServices {
if s.Name == svcName {
service = s
break
}
}
if service == nil {View on GitHub (pinned to 482b49bf1a)
Solutions
- Set the connect sidecar/gateway task's kind value to the target service name (e.g. kind = "connect-proxy:my-service")
- Verify variable interpolation in the task kind did not resolve to an empty string
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at client/allocrunner/taskrunner/envoy_bootstrap_hook.go:231 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/ce7c3a910a0b2484.
Report an issue: GitHub.