{"record":{"id":"e103f78926bbc890","repo":"apache/druid","slug":"invalid-listvalue-type","errorCode":null,"errorMessage":"Invalid ListValue type.","messagePattern":"Invalid ListValue type\\.","errorType":"exception","errorClass":"InvalidProtocolBufferException","httpStatus":null,"severity":"error","filePath":"extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufConverter.java","lineNumber":230,"sourceCode":"        msg -> {\n          final Map<Descriptors.FieldDescriptor, Object> fields = msg.getAllFields();\n          if (fields.isEmpty()) {\n            return null;\n          }\n          if (fields.size() != 1) {\n            throw new InvalidProtocolBufferException(\"Invalid Value type.\");\n          }\n          final Map.Entry<Descriptors.FieldDescriptor, Object> entry = fields.entrySet().stream().findFirst().get();\n          return convertSingleValue(entry.getKey(), entry.getValue());\n        }\n    );\n    converters.put(\n        ListValue.getDescriptor().getFullName(),\n        msg -> {\n          Descriptors.Descriptor descriptor = msg.getDescriptorForType();\n          Descriptors.FieldDescriptor field = descriptor.findFieldByName(\"values\");\n          if (field == null) {\n            throw new InvalidProtocolBufferException(\"Invalid ListValue type.\");\n          }\n          return convertList(field, (List<?>) msg.getField(field));\n        }\n    );\n    return converters;\n  }\n\n  @FunctionalInterface\n  interface SpecializedConverter\n  {\n    @Nullable\n    Object convert(Message msg) throws InvalidProtocolBufferException;\n  }\n}\n","sourceCodeStart":212,"sourceCodeEnd":245,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufConverter.java#L212-L245","documentation":"Druid registers a specialized converter for google.protobuf.ListValue that reads its repeated 'values' field. If the descriptor carrying the google.protobuf.ListValue full name lacks a 'values' field, the converter throws this InvalidProtocolBufferException because the descriptor does not match the well-known ListValue layout.","triggerScenarios":"convertField encounters a Message whose descriptor full name is google.protobuf.ListValue but descriptor.findFieldByName(\"values\") returns null, i.e. the runtime descriptor is not the real well-known type.","commonSituations":"Mismatched/shaded protobuf-java runtime versions; a custom message registered under the google.protobuf.ListValue name in a descriptor pool; corrupted schema-registry stored schema.","solutions":["Align protobuf-java versions across the classpath (remove shaded duplicates)","Re-register the correct schema if a custom descriptor shadows google.protobuf.ListValue","Restart Druid to reload clean descriptors after dependency fixes"],"exampleFix":"// before: shaded old protobuf jar bundled in a custom extension\nmy-extension.jar!/com/google/protobuf/ListValue.class\n// after: mark protobuf as provided in the extension pom\n<dependency>\n  <groupId>com.google.protobuf</groupId>\n  <artifactId>protobuf-java</artifactId>\n  <scope>provided</scope>\n</dependency>","handlingStrategy":"validation","validationCode":"Descriptors.Descriptor d = msg.getDescriptorForType();\nif (\"google.protobuf.ListValue\".equals(d.getFullName()) && d.findFieldByName(\"values\") == null) {\n  throw new IllegalStateException(\"google.protobuf.ListValue descriptor missing 'values'; check classpath\");\n}","typeGuard":"boolean isValidListValue(Message msg) {\n  return \"google.protobuf.ListValue\".equals(msg.getDescriptorForType().getFullName())\n      && msg.getDescriptorForType().findFieldByName(\"values\") != null;\n}","tryCatchPattern":"try {\n  Map<String, Object> row = ProtobufConverter.convertMessage(msg);\n} catch (InvalidProtocolBufferException e) {\n  if (e.getMessage().contains(\"Invalid ListValue type\")) {\n    log.error(\"ListValue descriptor mismatch — check protobuf-java duplicates\", e);\n  }\n  throw e;\n}","preventionTips":["Mark protobuf-java as provided in extension POMs to avoid shaded duplicates","Use maven-enforcer to ban duplicate classes of com.google.protobuf","Reload/restart Druid processes after dependency upgrades"],"tags":["protobuf","deserialization","classloading"],"backgroundTag":"internal-invariant-violation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}