{"record":{"id":"af2779d38b1a8773","repo":"grpc/grpc-java","slug":"httpconnectionmanager-neither-has-inlined-route-co","errorCode":null,"errorMessage":"HttpConnectionManager neither has inlined route_config nor RDS","messagePattern":"HttpConnectionManager neither has inlined route_config nor RDS","errorType":"exception","errorClass":"ResourceInvalidException","httpStatus":null,"severity":"error","filePath":"xds/src/main/java/io/grpc/xds/XdsListenerResource.java","lineNumber":571,"sourceCode":"      List<VirtualHost> virtualHosts = extractVirtualHosts(\n          proto.getRouteConfig(), filterRegistry, args);\n      return io.grpc.xds.HttpConnectionManager.forVirtualHosts(\n          maxStreamDuration, virtualHosts, filterConfigs);\n    }\n    if (proto.hasRds()) {\n      Rds rds = proto.getRds();\n      if (!rds.hasConfigSource()) {\n        throw new ResourceInvalidException(\n            \"HttpConnectionManager contains invalid RDS: missing config_source\");\n      }\n      if (!rds.getConfigSource().hasAds() && !rds.getConfigSource().hasSelf()) {\n        throw new ResourceInvalidException(\n            \"HttpConnectionManager contains invalid RDS: must specify ADS or self ConfigSource\");\n      }\n      return io.grpc.xds.HttpConnectionManager.forRdsName(\n          maxStreamDuration, rds.getRouteConfigName(), filterConfigs);\n    }\n    throw new ResourceInvalidException(\n        \"HttpConnectionManager neither has inlined route_config nor RDS\");\n  }\n\n  // hard-coded: currently router config is the only terminal filter.\n  private static boolean isTerminalFilter(Filter.FilterConfig filterConfig) {\n    return RouterFilter.ROUTER_CONFIG.equals(filterConfig);\n  }\n\n  @VisibleForTesting\n  @Nullable // Returns null if the filter is optional but not supported.\n  static StructOrError<Filter.FilterConfig> parseHttpFilter(\n      io.envoyproxy.envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter\n          httpFilter, FilterRegistry filterRegistry, boolean isForClient,\n      XdsResourceType.Args args) {\n    String filterName = httpFilter.getName();\n    boolean isOptional = httpFilter.getIsOptional();\n    if (!httpFilter.hasTypedConfig()) {\n      return isOptional ? null : StructOrError.fromError(","sourceCodeStart":553,"sourceCodeEnd":589,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/xds/src/main/java/io/grpc/xds/XdsListenerResource.java#L553-L589","documentation":"An HttpConnectionManager must provide routing information either as an inlined route_config or via an Rds reference. When neither field is present the resource is structurally incomplete, so xDS parsing throws ResourceInvalidException and the listener is discarded as invalid.","triggerScenarios":"parseHttpConnectionManager reaches the fall-through throw: the HttpConnectionManager proto has neither route_config (inlined) nor rds set.","commonSituations":"Minimal hand-written listener configs that only set http_filters; control planes emitting HCM stubs before filling routing; truncated or partially merged protobuf configs.","solutions":["Add an inline route_config with virtual_hosts to the HttpConnectionManager","Or set rds { route_config_name: ..., config_source: { ads: {} } } to discover routes dynamically","Inspect the management server output to confirm it is populating routing fields"],"exampleFix":"// before\nhttp_connection_manager: { http_filters: [...] }\n// after\nhttp_connection_manager: {\n  rds: { route_config_name: \"routes\", config_source: { ads: {} } }\n  http_filters: [...]\n}","handlingStrategy":"validation","validationCode":"// Java (proto): HCM must have inlined route_config or rds\nif (!hcm.hasRouteConfig() && !hcm.hasRds()) {\n  throw new IllegalArgumentException(\"HttpConnectionManager needs route_config or rds\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  xdsClient.watchResource(LISTENER, name, listenerWatcher);\n} catch (ResourceInvalidException e) {\n  log.error(\"HCM missing routing config: {}\", e.getMessage());\n}","preventionTips":["Always populate either route_config or rds in HttpConnectionManager","Add a control-plane smoke test asserting HCM completeness","Reject half-populated HCM stubs before publishing"],"tags":["xds","grpc","config-validation","routing"],"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-17T15:17:12.973Z"}