apache/druid · error · InvalidProtocolBufferException

Invalid ListValue type.

Error message

Invalid ListValue type.

What it means

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.

Source

Thrown at extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufConverter.java:230

        msg -> {
          final Map<Descriptors.FieldDescriptor, Object> fields = msg.getAllFields();
          if (fields.isEmpty()) {
            return null;
          }
          if (fields.size() != 1) {
            throw new InvalidProtocolBufferException("Invalid Value type.");
          }
          final Map.Entry<Descriptors.FieldDescriptor, Object> entry = fields.entrySet().stream().findFirst().get();
          return convertSingleValue(entry.getKey(), entry.getValue());
        }
    );
    converters.put(
        ListValue.getDescriptor().getFullName(),
        msg -> {
          Descriptors.Descriptor descriptor = msg.getDescriptorForType();
          Descriptors.FieldDescriptor field = descriptor.findFieldByName("values");
          if (field == null) {
            throw new InvalidProtocolBufferException("Invalid ListValue type.");
          }
          return convertList(field, (List<?>) msg.getField(field));
        }
    );
    return converters;
  }

  @FunctionalInterface
  interface SpecializedConverter
  {
    @Nullable
    Object convert(Message msg) throws InvalidProtocolBufferException;
  }
}

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Align protobuf-java versions across the classpath (remove shaded duplicates)
  2. Re-register the correct schema if a custom descriptor shadows google.protobuf.ListValue
  3. Restart Druid to reload clean descriptors after dependency fixes

Example fix

// before: shaded old protobuf jar bundled in a custom extension
my-extension.jar!/com/google/protobuf/ListValue.class
// after: mark protobuf as provided in the extension pom
<dependency>
  <groupId>com.google.protobuf</groupId>
  <artifactId>protobuf-java</artifactId>
  <scope>provided</scope>
</dependency>
Defensive patterns

Strategy: validation

Validate before calling

Descriptors.Descriptor d = msg.getDescriptorForType();
if ("google.protobuf.ListValue".equals(d.getFullName()) && d.findFieldByName("values") == null) {
  throw new IllegalStateException("google.protobuf.ListValue descriptor missing 'values'; check classpath");
}

Type guard

boolean isValidListValue(Message msg) {
  return "google.protobuf.ListValue".equals(msg.getDescriptorForType().getFullName())
      && msg.getDescriptorForType().findFieldByName("values") != null;
}

Try / catch

try {
  Map<String, Object> row = ProtobufConverter.convertMessage(msg);
} catch (InvalidProtocolBufferException e) {
  if (e.getMessage().contains("Invalid ListValue type")) {
    log.error("ListValue descriptor mismatch — check protobuf-java duplicates", e);
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/e103f78926bbc890. Report an issue: GitHub.