{"record":{"id":"4bd93b9470ea5831","repo":"hashicorp/nomad","slug":"consul-address-for-cluster-q-must-be-set-on-nomad","errorCode":null,"errorMessage":"consul address for cluster %q must be set on nomad client","messagePattern":"consul address for cluster %q must be set on nomad client","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/consul_grpc_sock_hook.go","lineNumber":247,"sourceCode":"\t// Only run once.\n\tif p.runOnce {\n\t\treturn nil\n\t}\n\n\t// Only run once. Never restart.\n\tselect {\n\tcase <-p.doneCh:\n\t\tp.logger.Trace(\"socket proxy already shutdown; exiting\")\n\t\treturn nil\n\tcase <-p.ctx.Done():\n\t\tp.logger.Trace(\"socket proxy already done; exiting\")\n\t\treturn nil\n\tdefault:\n\t}\n\n\t// make sure either grpc or http consul address has been configured\n\tif p.config.GRPCAddr == \"\" && p.config.Addr == \"\" {\n\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)","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/consul_grpc_sock_hook.go#L229-L265","documentation":"Socket-proxy run guard: neither a gRPC address (GRPCAddr) nor a plain HTTP address (Addr) is configured for the named Consul cluster on this Nomad client, so the proxy cannot determine its upstream destination and refuses to start.","triggerScenarios":"Thrown at client/allocrunner/consul_grpc_sock_hook.go:247 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set consul.addresses/<cluster>.grpc_http or grpc address in client config","Verify the client's Consul cluster configuration block name matches the one referenced by the services","Restart the Nomad client after fixing the config"],"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"}