{"record":{"id":"7b902c18f469151d","repo":"hashicorp/nomad","slug":"unable-to-parse-address-template-q-v","errorCode":null,"errorMessage":"unable to parse address template %q: %v","messagePattern":"unable to parse address template %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/consul_grpc_sock_hook.go","lineNumber":265,"sourceCode":"\t\treturn fmt.Errorf(\"consul address for cluster %q must be set on nomad client\",\n\t\t\tp.config.Name)\n\t}\n\n\tdestAddr := p.config.GRPCAddr\n\n\tif destAddr == \"\" {\n\t\t// No GRPCAddr defined. Use Addr but replace port with the gRPC\n\t\t// default of 8502.\n\t\thost, _, err := net.SplitHostPort(p.config.Addr)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error parsing Consul address %q: %v\", p.config.Addr, err)\n\t\t}\n\t\tdestAddr = net.JoinHostPort(host, p.consulGRPCFallbackPort)\n\t} else {\n\t\t// GRPCAddr may be sockaddr/template string, parse it.\n\t\tipStr, err := listenerutil.ParseSingleIPTemplate(destAddr)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to parse address template %q: %v\", destAddr, err)\n\t\t}\n\t\tdestAddr = ipStr\n\t}\n\n\tsocketFile := allocdir.AllocGRPCSocket\n\tif p.config.Name != structs.ConsulDefaultCluster && p.config.Name != \"\" {\n\t\tsocketFile = filepath.Join(allocdir.SharedAllocName, allocdir.TmpDirName,\n\t\t\t\"consul_\"+p.config.Name+\"_grpc.sock\")\n\t}\n\thostGRPCSocketPath := filepath.Join(p.allocDir.AllocDirPath(), socketFile)\n\n\t// if the socket already exists we'll try to remove it, but if not then any\n\t// other errors will bubble up to the caller here or when we try to listen\n\t_, err := os.Stat(hostGRPCSocketPath)\n\tif err == nil {\n\t\terr := os.Remove(hostGRPCSocketPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/consul_grpc_sock_hook.go#L247-L283","documentation":"Returned by the Consul gRPC socket hook when GRPCAddr is a sockaddr/template string that listenerutil.ParseSingleIPTemplate cannot parse. The template is meant to expand to a single address; anything else is unusable for the unix socket destination.","triggerScenarios":"Thrown at client/allocrunner/consul_grpc_sock_hook.go:265 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the sockaddr template in the consul grpc address config","Replace the template with a literal IP address","Verify node attributes used by the template exist (e.g. cloud metadata)"],"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"}