apache/druid · error · IllegalStateException

Unknown Notice type [ ].

Error message

Unknown Notice type [%s].

What it means

updateToLoadAndDrop() partitions pending notices into lookups to load vs. drop. A Notice instance that is neither a LoadNotice nor a DropNotice is a programming/invariant violation, so an IllegalStateException naming the class is thrown.

Solutions

  1. Add the new Notice subtype handling to the instanceof chain in updateToLoadAndDrop().
  2. Check for mixed Druid server jar versions on the classpath (e.g., duplicate LookupReferencesManager classes).
  3. Undo any custom code that enqueues non-standard Notice objects.
  4. Capture notice.getClass().getName() from the message and confirm which subtype is unhandled.

Example fix

// before
} else {
  throw new ISE("Unknown Notice type [%s].", notice.getClass().getName());
}
// after
} else if (notice instanceof RefreshNotice) {
  RefreshNotice r = (RefreshNotice) notice;
  lookupsToLoad.add(r.lookupName);
} else {
  throw new ISE("Unknown Notice type [%s].", notice.getClass().getName());
}
Defensive patterns

Strategy: validation

Validate before calling

// when adding custom notice types, assert handler coverage
if (!(notice instanceof LoadNotice) && !(notice instanceof DropNotice)) {
  throw new AssertionError("Unhandled Notice subtype: " + notice.getClass().getName());
}

Try / catch

try { state = manager.getAllLookupsState(...); } catch (IllegalStateException e) { if (e.getMessage().startsWith("Unknown Notice type")) { verifyDruidJarVersions(); } throw e; }

Prevention

When it happens

Trigger: A new Notice subtype is added to LookupReferencesManager but updateToLoadAndDrop()'s instanceof chain is not extended; internal state corruption passing a foreign object into the pendingNotices list.

Common situations: Druid version mismatches or custom patches introducing a new Notice type without updating the handler; classpath mixing of two Druid server versions.

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/35059ffacf185e47. Report an issue: GitHub.

Appendix: source

Thrown at server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java:370

  }

  private void updateToLoadAndDrop(
      List<Notice> notices,
      Map<String, LookupExtractorFactoryContainer> lookupsToLoad,
      Set<String> lookupsToDrop
  )
  {
    for (Notice notice : notices) {
      if (notice instanceof LoadNotice) {
        LoadNotice loadNotice = (LoadNotice) notice;
        lookupsToLoad.put(loadNotice.lookupName, loadNotice.lookupExtractorFactoryContainer);
        lookupsToDrop.remove(loadNotice.lookupName);
      } else if (notice instanceof DropNotice) {
        DropNotice dropNotice = (DropNotice) notice;
        lookupsToDrop.add(dropNotice.lookupName);
        lookupsToLoad.remove(dropNotice.lookupName);
      } else {
        throw new ISE("Unknown Notice type [%s].", notice.getClass().getName());
      }
    }
  }

  private void takeSnapshot(Map<String, LookupExtractorFactoryContainer> lookupMap)
  {
    if (lookupSnapshotTaker != null) {
      lookupSnapshotTaker.takeSnapshot(lookupListeningAnnouncerConfig.getLookupTier(), getLookupBeanList(lookupMap));
    }
  }

  /**
   * Load a set of lookups based on the injected value in {@link LoadSpecHolder#getLookupLoadingSpec()}.
   */
  private void loadLookupsAndInitStateRef()
  {
    LookupLoadingSpec lookupLoadingSpec = lookupListeningAnnouncerConfig.getLookupLoadingSpec();
    LOG.info("Loading lookups using spec[%s].", lookupLoadingSpec);

View on GitHub (pinned to 9b90983fd2)