{"record":{"id":"12c8d151ecf213e9","repo":"grpc/grpc-java","slug":"unknown-source-type-proto-getsourcetype","errorCode":null,"errorMessage":"Unknown source-type: ${proto.getSourceType()}","messagePattern":"Unknown source-type: (.+?)","errorType":"exception","errorClass":"ResourceInvalidException","httpStatus":null,"severity":"error","filePath":"xds/src/main/java/io/grpc/xds/XdsListenerResource.java","lineNumber":481,"sourceCode":"            InetAddresses.forString(range.getAddressPrefix()), range.getPrefixLen().getValue()));\n      }\n    } catch (IllegalArgumentException ex) {\n      throw new ResourceInvalidException(\"Failed to create CidrRange\", ex);\n    }\n\n    ConnectionSourceType sourceType;\n    switch (proto.getSourceType()) {\n      case ANY:\n        sourceType = ConnectionSourceType.ANY;\n        break;\n      case EXTERNAL:\n        sourceType = ConnectionSourceType.EXTERNAL;\n        break;\n      case SAME_IP_OR_LOOPBACK:\n        sourceType = ConnectionSourceType.SAME_IP_OR_LOOPBACK;\n        break;\n      default:\n        throw new ResourceInvalidException(\"Unknown source-type: \" + proto.getSourceType());\n    }\n    return FilterChainMatch.create(\n        proto.getDestinationPort().getValue(),\n        prefixRanges.build(),\n        ImmutableList.copyOf(proto.getApplicationProtocolsList()),\n        sourcePrefixRanges.build(),\n        sourceType,\n        ImmutableList.copyOf(proto.getSourcePortsList()),\n        ImmutableList.copyOf(proto.getServerNamesList()),\n        proto.getTransportProtocol());\n  }\n\n  @VisibleForTesting\n  static io.grpc.xds.HttpConnectionManager parseHttpConnectionManager(\n      HttpConnectionManager proto, FilterRegistry filterRegistry,\n      boolean isForClient, XdsResourceType.Args args) throws ResourceInvalidException {\n    if (proto.getXffNumTrustedHops() != 0) {\n      throw new ResourceInvalidException(","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/xds/src/main/java/io/grpc/xds/XdsListenerResource.java#L463-L499","documentation":"The FilterChainMatch's source_type field contains a value the gRPC xDS parser does not recognize. Only ANY, EXTERNAL, and SAME_IP_OR_LOOPBACK are mapped; anything else (typically an unrecognized future enum value) causes a ResourceInvalidException.","triggerScenarios":"FilterChainMatch proto with source_type set to an enum value other than ANY/EXTERNAL/SAME_IP_OR_LOOPBACK (falls through the switch's default in parseFilterChainMatch), usually because the control plane emitted a newer Envoy enum value than this gRPC version understands.","commonSituations":"Envoy control plane newer than the gRPC xDS client library, manually crafted protos with numeric enum values, or protos deserialized from JSON with an invalid string for source_type.","solutions":["Set source_type to ANY, EXTERNAL, or SAME_IP_OR_LOOPBACK (or omit it to use the default ANY).","Upgrade the gRPC library so it recognizes the enum value your control plane emits.","Downgrade or reconfigure the control plane not to send newer source_type values to older clients."],"exampleFix":"// before\nfilter_chain_match: { source_type: SOME_NEW_TYPE }\n// after\nfilter_chain_match: { source_type: ANY }","handlingStrategy":"validation","validationCode":"if (match.getSourceType() != ANY && match.getSourceType() != EXTERNAL\n    && match.getSourceType() != SAME_IP_OR_LOOPBACK) {\n  throw new IllegalArgumentException(\"source_type not supported by grpc xds\");\n}","typeGuard":null,"tryCatchPattern":"try { applyResource(listener) } catch (ResourceInvalidException e) { if (e.getMessage().startsWith(\"Unknown source-type\")) fallbackToSourceTypeAny(); }","preventionTips":["Only emit ANY, EXTERNAL, or SAME_IP_OR_LOOPBACK in source_type","Keep control plane enum knowledge in sync with the gRPC xDS client version","Avoid sending numeric enum values unknown to the client"],"tags":["grpc","xds","enum","config-validation"],"backgroundTag":"unsupported-enum-value","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"}