{"record":{"id":"7353f291a1536489","repo":"hashicorp/nomad","slug":"missing-q","errorCode":null,"errorMessage":"missing %q","messagePattern":"missing %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/taskrunner/envoy_bootstrap_hook.go","lineNumber":673,"sourceCode":"\t\t\treturn false, nil\n\t\tdefault:\n\t\t}\n\n\t\tallocServices, apiErr = h.consulServices.AllocRegistrations(h.alloc.ID)\n\t\tif apiErr != nil {\n\t\t\treturn true, apiErr\n\t\t}\n\n\t\tif allocServices != nil {\n\t\t\tfor _, taskServices := range allocServices.Tasks {\n\t\t\t\tfor id := range taskServices.Services {\n\t\t\t\t\tif id == proxyServiceID {\n\t\t\t\t\t\treturn false, nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tapiErr = fmt.Errorf(\"missing %q\", proxyServiceID)\n\t\treturn true, apiErr\n\t}, backoffOpts)\n\n\t// Wrap the last error we saw set that as our status.\n\tif backoffErr != nil {\n\t\treturn structs.NewRecoverableError(\n\t\t\tfmt.Errorf(\"%w: %v; see: <https://developer.hashicorp.com/nomad/s/envoy-bootstrap-error>\",\n\t\t\t\terrEnvoyBootstrapError,\n\t\t\t\tapiErr,\n\t\t\t),\n\t\t\ttrue)\n\t}\n\n\treturn nil\n}\n\nfunc durationFromMeta(node *structs.Node, key string, defaultDur time.Duration) time.Duration {\n\tval := node.Meta[key]","sourceCodeStart":655,"sourceCodeEnd":691,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/taskrunner/envoy_bootstrap_hook.go#L655-L691","documentation":"During the service preflight check, the hook repeatedly queries the Consul catalog/API to confirm the proxy's service ID is registered before bootstrapping Envoy. If the check closure never observes proxyServiceID (and never returns false early), it ends with this 'missing %q' error naming the proxy service ID, and the surrounding backoff retries until exhausted.","triggerScenarios":"Consul's API returns the list of service registrations but the expected proxyServiceID (the connect proxy for the task's service) is absent — e.g. registration is delayed, was deregistered, or the service was never registered due to an ACL/namespace mismatch.","commonSituations":"Slow Consul convergence right after task start (retries usually absorb it); Consul ACL token cannot see the service in the queried namespace/partition; the connect sidecar service is misconfigured or deregistered; multi-namespace/multi-partition setups where the hook queries the wrong namespace.","solutions":["Verify the service and its connect sidecar are actually registered in Consul (consul services / UI) in the correct namespace/partition.","Check the Consul ACL token used by Nomad has read access to the right namespace and services.","Increase patience via Consul health/registration settings or check for deregistration (e.g. Consul agents restarting, TTL checks failing).","Inspect agent logs around the recovery deadline; the wrapped error at the call site is recoverable and Nomad will retry/restart."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// confirm the proxy registration is visible in Consul before bootstrapping\nentries, _, err := consul.Catalog().Service(proxyServiceName, \"\", nil)\nif err != nil || len(entries) == 0 {\n    return fmt.Errorf(\"proxy %s not registered yet\", proxyServiceID)\n}","typeGuard":null,"tryCatchPattern":"err := hook.Prestart(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"missing\") {\n    // poll Consul catalog until the proxy ID appears, then reschedule\n}","preventionTips":["Give Consul time to converge; rely on the hook's backoff rather than immediate restarts.","Use correct namespace/partition in job service stanzas so registrations land where the hook looks.","Ensure the Consul ACL token can read services in the target namespace.","Monitor Consul deregistration events (agent restarts, TTL failures)."],"tags":["nomad","consul","connect","registration","retry"],"backgroundTag":"consul-proxy-not-registered","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"}