{"record":{"id":"dced9cf63fbdc5da","repo":"grpc/grpc-java","slug":"unknown-value-type","errorCode":null,"errorMessage":"Unknown Value type: ","messagePattern":"Unknown Value type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"xds/src/main/java/io/grpc/xds/internal/ProtobufJsonConverter.java","lineNumber":58,"sourceCode":"\n  private static Object convertValue(Value value) {\n    switch (value.getKindCase()) {\n      case STRUCT_VALUE:\n        return convertToJson(value.getStructValue());\n      case LIST_VALUE:\n        return value.getListValue().getValuesList().stream()\n            .map(ProtobufJsonConverter::convertValue)\n            .collect(Collectors.toList());\n      case NUMBER_VALUE:\n        return value.getNumberValue();\n      case STRING_VALUE:\n        return value.getStringValue();\n      case BOOL_VALUE:\n        return value.getBoolValue();\n      case NULL_VALUE:\n        return null;\n      default:\n        throw new IllegalArgumentException(\"Unknown Value type: \" + value.getKindCase());\n    }\n  }\n}\n","sourceCodeStart":40,"sourceCodeEnd":62,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/xds/src/main/java/io/grpc/xds/internal/ProtobufJsonConverter.java#L40-L62","documentation":"ProtobufJsonConverter.convertValue converts a google.protobuf.Value into a plain Java object by switching on the Value's kind case. When the kind is not a recognized case (struct/list/number/string/bool/null), it throws an IllegalArgumentException naming the KindCase. This indicates a malformed or unsupported protobuf Value.","triggerScenarios":"convertToJson encounters a google.protobuf.Value whose kind is KIND_NOT_SET or an unrecognized case from a newer protobuf API version.","commonSituations":"Proto built without setting any kind field; custom metadata in xDS config carrying an unset Value; protobuf runtime version mismatch between producer and consumer.","solutions":["Ensure every google.protobuf.Value in the source config has exactly one kind set","Fix the config producer that emitted the unset Value","Upgrade the protobuf/grpc-xds libraries if a new Value kind is involved","Add upstream validation rejecting Values with KIND_NOT_SET"],"exampleFix":"// before: Value with no kind set\nValue.newBuilder().build()\n// after\nValue.newBuilder().setStringValue(\"prod\").build()","handlingStrategy":"validation","validationCode":"if (value.getKindCase() == Value.KindCase.KIND_NOT_SET) { reject(\"Value has no kind set\"); }","typeGuard":"null","tryCatchPattern":"try { json = ProtobufJsonConverter.convertToJson(struct); }\ncatch (IllegalArgumentException e) { log.error(\"Unsupported Value kind\", e); treatAsEmpty(); }","preventionTips":["Always set exactly one kind field on google.protobuf.Value","Keep protobuf runtime versions consistent","Validate metadata in config before distribution"],"tags":["xds","protobuf","conversion","validation"],"backgroundTag":"invalid-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"}