{"record":{"id":"d3adfce4a2b57d7b","repo":"grpc/grpc-java","slug":"invalid-bootstrap-missing-server-uri","errorCode":null,"errorMessage":"Invalid bootstrap: missing 'server_uri'","messagePattern":"Invalid bootstrap: missing 'server_uri'","errorType":"exception","errorClass":"XdsInitializationException","httpStatus":null,"severity":"critical","filePath":"xds/src/main/java/io/grpc/xds/client/BootstrapperImpl.java","lineNumber":264,"sourceCode":"\n    return builder;\n  }\n\n  protected Optional<Object> parseImplSpecificObject(\n      @Nullable Map<String, ?> rawAllowedGrpcServices)\n      throws XdsInitializationException {\n    return Optional.empty();\n  }\n\n  private List<ServerInfo> parseServerInfos(List<?> rawServerConfigs, XdsLogger logger)\n      throws XdsInitializationException {\n    logger.log(XdsLogLevel.INFO, \"Configured with {0} xDS servers\", rawServerConfigs.size());\n    ImmutableList.Builder<ServerInfo> servers = ImmutableList.builder();\n    List<Map<String, ?>> serverConfigList = JsonUtil.checkObjectList(rawServerConfigs);\n    for (Map<String, ?> serverConfig : serverConfigList) {\n      String serverUri = JsonUtil.getString(serverConfig, \"server_uri\");\n      if (serverUri == null) {\n        throw new XdsInitializationException(\"Invalid bootstrap: missing 'server_uri'\");\n      }\n      logger.log(XdsLogLevel.INFO, \"xDS server URI: {0}\", serverUri);\n\n      Object implSpecificConfig = getImplSpecificConfig(serverConfig, serverUri);\n\n      boolean resourceTimerIsTransientError = false;\n      boolean ignoreResourceDeletion = false;\n      boolean failOnDataErrors = false;\n      // \"For forward compatibility reasons, the client will ignore any entry in the list that it\n      // does not understand, regardless of type.\"\n      List<?> serverFeatures = JsonUtil.getList(serverConfig, \"server_features\");\n      if (serverFeatures != null) {\n        logger.log(XdsLogLevel.INFO, \"Server features: {0}\", serverFeatures);\n        if (serverFeatures.contains(SERVER_FEATURE_IGNORE_RESOURCE_DELETION)) {\n          ignoreResourceDeletion = true;\n        }\n        resourceTimerIsTransientError = xdsDataErrorHandlingEnabled\n            && serverFeatures.contains(SERVER_FEATURE_RESOURCE_TIMER_IS_TRANSIENT_ERROR);","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/xds/src/main/java/io/grpc/xds/client/BootstrapperImpl.java#L246-L282","documentation":"Each entry in the 'xds_servers' bootstrap array must contain a 'server_uri' string identifying the control-plane server address. BootstrapperImpl.parseServerInfos throws XdsInitializationException when JsonUtil.getString(serverConfig, \"server_uri\") returns null, since a server entry without a URI is unusable.","triggerScenarios":"An xds_servers entry missing the \"server_uri\" key, misspelling it (e.g. \"uri\", \"serverUrl\"), or giving a JSON null / non-string value.","commonSituations":"Hand-written bootstrap files; partially generated config where the templating dropped the address; copying config examples with placeholder addresses removed.","solutions":["Add \"server_uri\": \"<address>\" (e.g. \"dns:///xds.example.com:443\" or \"unix:/path/to/socket\") to every xds_servers entry.","Fix misspelled key names to exactly \"server_uri\".","Ensure the value is a non-null JSON string, not a placeholder or null literal."],"exampleFix":"// before\n\"xds_servers\": [{ \"channel_creds\": [{\"type\": \"insecure\"}] }]\n// after\n\"xds_servers\": [{ \"server_uri\": \"dns:///xds.example.com:443\",\n                   \"channel_creds\": [{\"type\": \"insecure\"}] }]","handlingStrategy":"validation","validationCode":"for (Object o : xdsServers) {\n  java.util.Map<String, ?> srv = (java.util.Map<String, ?>) o;\n  Object uri = srv.get(\"server_uri\");\n  if (!(uri instanceof String) || ((String) uri).isEmpty()) {\n    throw new IllegalStateException(\"xds_servers entry missing string 'server_uri'\");\n  }\n}","typeGuard":"boolean hasServerUri(java.util.Map<String, ?> serverConfig) {\n  return serverConfig.get(\"server_uri\") instanceof String\n      && !((String) serverConfig.get(\"server_uri\")).isEmpty();\n}","tryCatchPattern":null,"preventionTips":["Ensure every xds_servers entry has a non-empty \"server_uri\" string.","Validate bootstrap JSON against the spec before deploying.","Watch for templating pipelines that drop optional-looking fields like addresses."],"tags":["grpc","xds","bootstrap","config-validation"],"backgroundTag":"missing-required-config-field","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"}