{"record":{"id":"2e2a0d8c557295c4","repo":"grpc/grpc-go","slug":"rls-empty-lookup-service-in-route-lookup-config","errorCode":null,"errorMessage":"rls: empty lookup_service in route lookup config %+v","messagePattern":"rls: empty lookup_service in route lookup config %\\+v","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"balancer/rls/config.go","lineNumber":196,"sourceCode":"\t\treturn nil, err\n\t}\n\tlbCfg.childPolicyName = name\n\tlbCfg.childPolicyConfig = config\n\tlbCfg.childPolicyTargetField = cfgJSON.ChildPolicyConfigTargetFieldName\n\treturn lbCfg, nil\n}\n\nfunc parseRLSProto(rlsProto *rlspb.RouteLookupConfig) (*lbConfig, error) {\n\t// Validations specified on the `grpc_keybuilders` field are performed here.\n\tkbMap, err := keys.MakeBuilderMap(rlsProto)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// `lookup_service` field must be set and must parse as a target URI.\n\tlookupService := rlsProto.GetLookupService()\n\tif lookupService == \"\" {\n\t\treturn nil, fmt.Errorf(\"rls: empty lookup_service in route lookup config %+v\", rlsProto)\n\t}\n\tparsedTarget, err := url.Parse(lookupService)\n\tif err != nil {\n\t\t// url.Parse() fails if scheme is missing. Retry with default scheme.\n\t\tparsedTarget, err = url.Parse(resolver.GetDefaultScheme() + \":///\" + lookupService)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"rls: invalid target URI in lookup_service %s\", lookupService)\n\t\t}\n\t}\n\tif parsedTarget.Scheme == \"\" {\n\t\tparsedTarget.Scheme = resolver.GetDefaultScheme()\n\t}\n\tif resolver.Get(parsedTarget.Scheme) == nil {\n\t\treturn nil, fmt.Errorf(\"rls: unregistered scheme in lookup_service %s\", lookupService)\n\t}\n\n\tlookupServiceTimeout, err := convertDuration(rlsProto.GetLookupServiceTimeout())\n\tif err != nil {","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/grpc/grpc-go/blob/0c51461d27177d997e14c642fe18c11668fc09a3/balancer/rls/config.go#L178-L214","documentation":"Emitted from parseRLSProto (config.go:196) when RouteLookupConfig.lookup_service is the empty string. The lookup_service is the address of the Route Lookup Server and is required; without it the RLS balancer has nowhere to send RouteLookup RPCs.","triggerScenarios":"The routeLookupConfig object omits lookupService/lookup_service, or sets it to an empty string. The check runs after key-builder validation and before URI parsing.","commonSituations":"An xDS RLS config where the lookup service hostname template was never filled in; a templated config whose ${RLS_HOST} variable expanded to empty; misconfiguration during initial rollout of RLS.","solutions":["Set lookupService to the URI of the Route Lookup Server, e.g. 'rls://rls.example.com:443' or 'dns:///rls.example.com:443'.","If the value is templated, ensure the template variable is populated before the config is applied (fail the deploy if it is empty).","Verify the xDS RouteLookupConfig resource on the control plane has lookup_service populated and that the resource version is active."],"exampleFix":"// before\n\"routeLookupConfig\": { \"lookupService\": \"\", \"grpcKeybuilders\": [ ... ] }\n\n// after\n\"routeLookupConfig\": { \"lookupService\": \"dns:///rls.example.com:443\", \"grpcKeybuilders\": [ ... ] }","handlingStrategy":"validation","validationCode":"func validateLookupService(s string) error {\n    if strings.TrimSpace(s) == \"\" {\n        return errors.New(\"routeLookupConfig.lookupService must be non-empty\")\n    }\n    return nil\n}","typeGuard":"func hasLookupService(s string) bool { return strings.TrimSpace(s) != \"\" }","tryCatchPattern":null,"preventionTips":["Fail the deploy if the RLS host template variable is unset.","Treat lookupService as a required field in config schema validation.","Log the effective lookupService value at startup for quick diagnosis."],"tags":["rls","lookup-service","validation","service-config"],"backgroundTag":null,"analyzedSha":"0c51461d27177d997e14c642fe18c11668fc09a3","analyzedAt":"2026-08-11T14:49:15.055Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}