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

  1. Load the extension providing the serde on the reading node (druid.extensions.loadList)
  2. Align extension configuration across all Druid services
  3. 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

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


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 MetricType

View on GitHub (pinned to 9b90983fd2)