{"record":{"id":"22ae170c17efd3ae","repo":"grpc/grpc-java","slug":"invalid-bootstrap-fieldname-does-not-exist","errorCode":null,"errorMessage":"Invalid bootstrap: '${fieldName}' does not exist.","messagePattern":"Invalid bootstrap: '(.+?)' does not exist\\.","errorType":"exception","errorClass":"XdsInitializationException","httpStatus":null,"severity":"critical","filePath":"xds/src/main/java/io/grpc/xds/client/BootstrapperImpl.java","lineNumber":318,"sourceCode":"  /**\n   * Reads the content of the file with the given path in the file system.\n   */\n  public interface FileReader {\n    String readFile(String path) throws IOException;\n  }\n\n  protected enum LocalFileReader implements FileReader {\n    INSTANCE;\n\n    @Override\n    public String readFile(String path) throws IOException {\n      return new String(Files.readAllBytes(Paths.get(path)), StandardCharsets.UTF_8);\n    }\n  }\n\n  private static <T> T checkForNull(T value, String fieldName) throws XdsInitializationException {\n    if (value == null) {\n      throw new XdsInitializationException(\n          \"Invalid bootstrap: '\" + fieldName + \"' does not exist.\");\n    }\n    return value;\n  }\n\n}\n","sourceCodeStart":300,"sourceCodeEnd":325,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/xds/src/main/java/io/grpc/xds/client/BootstrapperImpl.java#L300-L325","documentation":"BootstrapperImpl.checkForNull is a generic validator used while parsing server config fields (e.g. channel creds type, cert paths) during bootstrap. Any required field whose extracted value is null produces XdsInitializationException(\"Invalid bootstrap: '<fieldName>' does not exist.\").","triggerScenarios":"A required bootstrap field — such as \"channel_creds\", \"creds\" entries, \"type\", \"certificate\" paths, or \"ca_certificate_file\" referenced from xds_servers — is absent or null. The specific field name appears in the message.","commonSituations":"TLS-secured xDS configs where credential files were removed or paths renamed; stripped-down bootstrap files missing channel_creds; mismatches between bootstrap spec versions where a field was renamed.","solutions":["Add the named field (given verbatim in the message) to the relevant section of the bootstrap JSON.","If the field references a file (certs/CA), confirm the file exists and the path is correct.","Compare your bootstrap file against a known-good example for your control plane (Traffic Director, Istio, Envoy SDS).","Ensure you're using a bootstrap spec version compatible with your gRPC-xDS library version."],"exampleFix":"// before\n\"xds_servers\": [{ \"server_uri\": \"dns:///xds.example.com:443\" }]\n// after\n\"xds_servers\": [{ \"server_uri\": \"dns:///xds.example.com:443\",\n                   \"channel_creds\": [{\"type\": \"google_default\"}] }]","handlingStrategy":"validation","validationCode":"java.util.Set<String> required = java.util.Set.of(\"server_uri\", \"channel_creds\");\nfor (String field : required) {\n  if (!serverConfig.containsKey(field) || serverConfig.get(field) == null) {\n    throw new IllegalStateException(\"bootstrap server config missing '\" + field + \"'\");\n  }\n}\n// also verify any referenced cert/CA files exist on disk","typeGuard":null,"tryCatchPattern":null,"preventionTips":["The message names the exact missing field — add it to the bootstrap JSON.","Verify all credential file paths referenced by the bootstrap exist and are readable.","Keep bootstrap files versioned with the workload config so fields are not accidentally dropped."],"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"}