{"record":{"id":"7cb9390ef85ac024","repo":"grpc/grpc-java","slug":"target-uri-scheme-is-not-resolvable-targeturi","errorCode":null,"errorMessage":"Target URI scheme is not resolvable: \" + targetUri","messagePattern":"Target URI scheme is not resolvable: \" \\+ targetUri","errorType":"validation","errorClass":"GrpcServiceParseException","httpStatus":null,"severity":"error","filePath":"xds/src/main/java/io/grpc/xds/GrpcServiceConfigParser.java","lineNumber":168,"sourceCode":"        Optional.ofNullable(allowedGrpcServices.services().get(targetUri));\n\n    boolean isTargetUriSchemeSupported = false;\n    try {\n      URI uri = new URI(targetUri);\n      String scheme = uri.getScheme();\n      if (scheme == null) {\n        scheme = NameResolverRegistry.getDefaultRegistry().getDefaultScheme();\n      }\n      if (scheme != null) {\n        isTargetUriSchemeSupported =\n            NameResolverRegistry.getDefaultRegistry().getProviderForScheme(scheme) != null;\n      }\n    } catch (URISyntaxException e) {\n      // Fallback or ignore if not a valid URI\n    }\n\n    if (!isTargetUriSchemeSupported) {\n      throw new GrpcServiceParseException(\"Target URI scheme is not resolvable: \" + targetUri);\n    }\n\n    if (!isTrustedControlPlane) {\n      if (!override.isPresent()) {\n        throw new GrpcServiceParseException(\n            \"Untrusted xDS server & URI not found in allowed_grpc_services: \" + targetUri);\n      }\n\n      GrpcServiceConfig.GoogleGrpcConfig.Builder builder =\n          GrpcServiceConfig.GoogleGrpcConfig.builder().target(targetUri)\n              .configuredChannelCredentials(override.get().configuredChannelCredentials());\n      if (override.get().callCredentials().isPresent()) {\n        builder.callCredentials(override.get().callCredentials().get());\n      }\n      return builder.build();\n    }\n\n    ConfiguredChannelCredentials channelCreds =","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/xds/src/main/java/io/grpc/xds/GrpcServiceConfigParser.java#L150-L186","documentation":"Thrown by GrpcServiceConfigParser.parseGoogleGrpcConfig when the GrpcService's target_uri scheme cannot be resolved: the parser could not parse it as a URI or the scheme is not among the supported ones (e.g. not 'dns' or 'xds'). The client cannot construct a channel to the xDS server described by the target URI, so parsing fails.","triggerScenarios":"google_grpc.target_uri uses an unsupported or missing scheme (e.g. 'unix:', 'uds://', a bare hostname the parser's URI check rejects, or an empty string), so isTargetUriSchemeSupported stays false after the URI parsing fallback.","commonSituations":"Control plane configured with unix-socket addresses for the xDS server; target_uri strings like 'xds_cluster' without a scheme; malformed URIs with illegal characters caught by URISyntaxException and then failing the scheme check.","solutions":["Set target_uri to a supported form, e.g. 'dns:///xds.example.com:443' or an xds-scheme URI matching your bootstrap servers.","Verify the target_uri scheme matches what grpc-java supports in your version (dns/xds).","Fix characters that break URI parsing (spaces, unencoded non-ASCII) in target_uri."],"exampleFix":"// before\n target_uri: \"unix:/var/run/xds.sock\"\n// after\n target_uri: \"dns:///xds.example.com:443\"","handlingStrategy":"validation","validationCode":"// Pre-check that target_uri parses and has a supported scheme\nURI uri;\ntry { uri = new URI(targetUri); } catch (URISyntaxException e) {\n  throw new IllegalArgumentException(\"target_uri not a valid URI: \" + targetUri); }\nString scheme = uri.getScheme();\nif (scheme == null || !(scheme.equals(\"dns\") || scheme.equals(\"xds\"))) {\n  throw new IllegalArgumentException(\"unsupported target_uri scheme: \" + scheme);\n}","typeGuard":null,"tryCatchPattern":"try {\n  config = GrpcServiceConfigParser.parse(proto, bootstrapInfo, serverInfo);\n} catch (GrpcServiceParseException e) {\n  if (e.getMessage().startsWith(\"Target URI scheme\")) {\n    logger.log(WARNING, \"Fix target_uri to dns:///host:port form: \" + e.getMessage());\n  }\n}","preventionTips":["Always use dns:///host:port or a supported xds scheme for target_uri","Avoid unix socket addresses in GrpcService target_uri for grpc-java","URI-encode any unusual characters in hostnames"],"tags":["xds","uri","target-uri","validation"],"backgroundTag":"invalid-url-format","analyzedSha":"64daddc1f3d1975670f769f3e97bde8b2ba32d25","analyzedAt":"2026-09-08T06:14:57.704Z","contentChangedAt":"2026-09-08T06:14:57.704Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}