{"record":{"id":"6d46fe3b065d4961","repo":"grpc/grpc-java","slug":"invalid-input-config-typeurl","errorCode":null,"errorMessage":"Invalid input config: ${typeUrl}","messagePattern":"Invalid input config: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"xds/src/main/java/io/grpc/xds/internal/matcher/HeaderMatchInput.java","lineNumber":104,"sourceCode":"      return null;\n    }\n    return String.join(\",\", values);\n  }\n\n  @Override\n  public Class<?> outputType() {\n    return String.class;\n  }\n\n  static final class Provider implements MatchInputProvider {\n    @Override\n    public HeaderMatchInput getInput(TypedExtensionConfig config) {\n      try {\n        HttpRequestHeaderMatchInput proto = config.getTypedConfig()\n            .unpack(HttpRequestHeaderMatchInput.class);\n        return new HeaderMatchInput(proto.getHeaderName());\n      } catch (InvalidProtocolBufferException e) {\n        throw new IllegalArgumentException(\n            \"Invalid input config: \" + config.getTypedConfig().getTypeUrl(), e);\n      }\n    }\n\n    @Override\n    public String typeUrl() {\n      return TYPE_URL;\n    }\n  }\n}\n","sourceCodeStart":86,"sourceCodeEnd":115,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/xds/src/main/java/io/grpc/xds/internal/matcher/HeaderMatchInput.java#L86-L115","documentation":"The factory getInput unpacks the extension's Any-typed config into HttpRequestHeaderMatchInput. If the Any payload is not actually that message (wrong type_url / corrupted bytes), unpacking fails with InvalidProtocolBufferException, rethrown as IllegalArgumentException naming the typeUrl.","triggerScenarios":"Passing a TypedExtensionConfig whose typed_config's typeUrl does not correspond to type.googleapis.com/envoy.config.route.v3.HeaderMatchInput or whose bytes cannot be parsed as HttpRequestHeaderMatchInput.","commonSituations":"Wrong extension type referenced in route matcher config (e.g. CEL input wired where a header input is expected), stale generated proto classes, or xDS control plane emitting a config for a newer/older Envoy API version.","solutions":["Verify the type_url of the typed_config matches the HttpRequestHeaderMatchInput type URL expected by typeUrl().","Regenerate/align proto classes with the xDS control plane's Envoy API version.","Check that the serialized Any payload was produced from HttpRequestHeaderMatchInput, not another message."],"exampleFix":"// before\n{\"typed_config\": {\"@type\": \".../HttpAttributesCelMatchInput\", ...}}\n// after\n{\"typed_config\": {\"@type\": \".../HttpRequestHeaderMatchInput\", \"header_name\": \"x-user-id\"}}","handlingStrategy":"try-catch","validationCode":"if (!\"type.googleapis.com/envoy.config.route.v3.HeaderMatchInput\".equals(config.getTypedConfig().getTypeUrl())) {\n  throw new IllegalArgumentException(\"wrong extension type: \" + config.getTypedConfig().getTypeUrl());\n}","typeGuard":"static boolean isHeaderMatchInput(TypedExtensionConfig config) {\n  return config.getTypedConfig().getTypeUrl().endsWith(\"HeaderMatchInput\");\n}","tryCatchPattern":"try {\n  input = factory.getInput(config);\n} catch (IllegalArgumentException e) {\n  if (e.getCause() instanceof InvalidProtocolBufferException) {\n    // wrong type_url or corrupt payload; fix typeUrl before retry\n  }\n  throw e;\n}","preventionTips":["Verify type_url strings match the generated proto package version","Keep proto classes in sync with the xDS control plane's Envoy API version","Log the failing typeUrl when unpacking fails"],"tags":["xds","protobuf","config-validation"],"backgroundTag":"protobuf-unmarshal-failed","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"}