{"record":{"id":"35059ffacf185e47","repo":"apache/druid","slug":"unknown-notice-type-s","errorCode":null,"errorMessage":"Unknown Notice type [%s].","messagePattern":"Unknown Notice type \\[(.+?)\\]\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java","lineNumber":370,"sourceCode":"  }\n\n  private void updateToLoadAndDrop(\n      List<Notice> notices,\n      Map<String, LookupExtractorFactoryContainer> lookupsToLoad,\n      Set<String> lookupsToDrop\n  )\n  {\n    for (Notice notice : notices) {\n      if (notice instanceof LoadNotice) {\n        LoadNotice loadNotice = (LoadNotice) notice;\n        lookupsToLoad.put(loadNotice.lookupName, loadNotice.lookupExtractorFactoryContainer);\n        lookupsToDrop.remove(loadNotice.lookupName);\n      } else if (notice instanceof DropNotice) {\n        DropNotice dropNotice = (DropNotice) notice;\n        lookupsToDrop.add(dropNotice.lookupName);\n        lookupsToLoad.remove(dropNotice.lookupName);\n      } else {\n        throw new ISE(\"Unknown Notice type [%s].\", notice.getClass().getName());\n      }\n    }\n  }\n\n  private void takeSnapshot(Map<String, LookupExtractorFactoryContainer> lookupMap)\n  {\n    if (lookupSnapshotTaker != null) {\n      lookupSnapshotTaker.takeSnapshot(lookupListeningAnnouncerConfig.getLookupTier(), getLookupBeanList(lookupMap));\n    }\n  }\n\n  /**\n   * Load a set of lookups based on the injected value in {@link LoadSpecHolder#getLookupLoadingSpec()}.\n   */\n  private void loadLookupsAndInitStateRef()\n  {\n    LookupLoadingSpec lookupLoadingSpec = lookupListeningAnnouncerConfig.getLookupLoadingSpec();\n    LOG.info(\"Loading lookups using spec[%s].\", lookupLoadingSpec);","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java#L352-L388","documentation":"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.","triggerScenarios":"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.","commonSituations":"Druid version mismatches or custom patches introducing a new Notice type without updating the handler; classpath mixing of two Druid server versions.","solutions":["Add the new Notice subtype handling to the instanceof chain in updateToLoadAndDrop().","Check for mixed Druid server jar versions on the classpath (e.g., duplicate LookupReferencesManager classes).","Undo any custom code that enqueues non-standard Notice objects.","Capture notice.getClass().getName() from the message and confirm which subtype is unhandled."],"exampleFix":"// before\n} else {\n  throw new ISE(\"Unknown Notice type [%s].\", notice.getClass().getName());\n}\n// after\n} else if (notice instanceof RefreshNotice) {\n  RefreshNotice r = (RefreshNotice) notice;\n  lookupsToLoad.add(r.lookupName);\n} else {\n  throw new ISE(\"Unknown Notice type [%s].\", notice.getClass().getName());\n}","handlingStrategy":"validation","validationCode":"// when adding custom notice types, assert handler coverage\nif (!(notice instanceof LoadNotice) && !(notice instanceof DropNotice)) {\n  throw new AssertionError(\"Unhandled Notice subtype: \" + notice.getClass().getName());\n}","typeGuard":null,"tryCatchPattern":"try { state = manager.getAllLookupsState(...); } catch (IllegalStateException e) { if (e.getMessage().startsWith(\"Unknown Notice type\")) { verifyDruidJarVersions(); } throw e; }","preventionTips":["Update updateToLoadAndDrop() whenever adding a new Notice subtype","Keep all Druid server jars at the same version on the classpath","Never enqueue foreign Notice implementations into pendingNotices"],"tags":["internal","invariant","version-mismatch"],"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-17T15:17:12.973Z"}