apache/druid · error · IllegalStateException
Unknown type[ ], cannot load.
Error message
Unknown type[%s], cannot load.
What it means
Also in MetricHolder.fromByteBuffer: after parsing the type name, a COMPLEX metric needs a registered ComplexMetricSerde; if ComplexMetrics.getSerdeForType returns null the loader throws ISE 'Unknown type, cannot load'. The running JVM lacks the serde for that complex metric type.
Solutions
- Load the extension providing the serde on the reading node (druid.extensions.loadList)
- Align extension configuration across all Druid services
- Re-ingest or convert the segment to replace obsolete complex metric types
Example fix
// before druid.extensions.loadList=[] // after druid.extensions.loadList=["druid-datasketches"] // registers serde for the sketch type in the segment
Defensive patterns
Strategy: validation
Validate before calling
String complexType = holder.getTypeName(); if (ComplexMetrics.getSerdeForType(complexType) == null) { /* load extension or fail fast before reading */ } Type guard
boolean canLoadComplexMetric(String typeName) { return ComplexMetrics.getSerdeForType(typeName) != null; } Try / catch
try { MetricHolder.fromByteBuffer(buf); } catch (ISE e) { if (e.getMessage().contains("cannot load")) { /* register missing serde/extension and retry */ } else throw e; } Prevention
- Install all extensions referenced by ingested metric types on every node
- Use the same extension load list across ingestion and query clusters
- Prefer standard sketch extensions (druid-datasketches) over ad-hoc types
When it happens
Trigger: Loading a legacy segment containing a complex metric (e.g. hyperUnique, sketches) whose extension is not loaded on this node.
Common situations: Historical nodes missing extensions that ingestion nodes had; moving segments between clusters with different extension sets; renamed/removed complex metric types across versions.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
- A-Not-B requires at least 1 sketch
- Access-Check-Result
- Action [ ] failed for worker [ ] with status ( )
- Actual Row count mismatch. Expected
- Aggregation [ ] does not support column [ ] of type [ ]…
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/15be1fb13b8c8b5a.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/segment/MetricHolder.java:67
}
final String metricName = SERIALIZER_UTILS.readString(buf);
final String typeName = SERIALIZER_UTILS.readString(buf);
MetricHolder holder = new MetricHolder(metricName, typeName);
switch (holder.type) {
case FLOAT:
holder.floatType = CompressedColumnarFloatsSupplier.fromByteBuffer(
buf,
ByteOrder.nativeOrder(),
null // OK since this method is only used for legacy segments, which always use version 1 indexed
);
break;
case COMPLEX:
final ComplexMetricSerde serdeForType = ComplexMetrics.getSerdeForType(holder.getTypeName());
if (serdeForType == null) {
throw new ISE("Unknown type[%s], cannot load.", holder.getTypeName());
}
holder.complexType = read(buf, serdeForType);
break;
case LONG:
case DOUBLE:
throw new ISE("Unsupported type[%s]", holder.type);
}
return holder;
}
private static <T> GenericIndexed<T> read(ByteBuffer buf, ComplexMetricSerde serde)
{
return GenericIndexed.read(buf, serde.getObjectStrategy(), null);
}
public enum MetricTypeView on GitHub (pinned to 9b90983fd2)