{"record":{"id":"2aed94b6dec99544","repo":"apache/druid","slug":"cannot-find-generator-for-namespace-s","errorCode":null,"errorMessage":"Cannot find generator for namespace [%s]","messagePattern":"Cannot find generator for namespace \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/CacheScheduler.java","lineNumber":530,"sourceCode":"    finally {\n      if (!success) {\n        // ExecutionException's cause is logged in entry.close()\n        entry.close();\n        if (loadException != null) {\n          log.error(loadException, \"CacheScheduler[%s] - problem during start or waiting for the first run\", entry);\n        } else {\n          log.error(\"CacheScheduler[%s] - problem during start or waiting for the first run\", entry);\n        }\n      }\n    }\n  }\n\n  public <T extends ExtractionNamespace> Entry schedule(final T namespace)\n  {\n    @SuppressWarnings(\"unchecked\")\n    final CacheGenerator<T> generator = (CacheGenerator<T>) namespaceGeneratorMap.get(namespace.getClass());\n    if (generator == null) {\n      throw new ISE(\"Cannot find generator for namespace [%s]\", namespace);\n    }\n    return new Entry<>(namespace, generator);\n  }\n}\n","sourceCodeStart":512,"sourceCodeEnd":535,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/CacheScheduler.java#L512-L535","documentation":"CacheScheduler.schedule() looks up a CacheGenerator by the namespace's concrete class in namespaceGeneratorMap. If no generator was registered for that ExtractionNamespace type, schedule() cannot create the entry and throws this ISE naming the namespace.","triggerScenarios":"Calling scheduler.schedule(namespace) with an ExtractionNamespace subclass that has no registered CacheGenerator (e.g. a custom namespace type not wired into the scheduler, or an extension namespace whose module wasn't loaded).","commonSituations":"Custom ExtractionNamespace implementation without registering its generator in the scheduler's constructor; using a lookup type provided by an extension that isn't loaded; reflection-created namespace objects with a type not supported in this runtime.","solutions":["Use a supported namespace type (JdbcExtractionNamespace, UriExtractionNamespace, etc.).","If custom, register your CacheGenerator for the namespace class when constructing CacheScheduler.","Load the extension module that provides the generator for the namespace type."],"exampleFix":"// before\nscheduler.schedule(new MyCustomNamespace(...)); // ISE: no generator\n// after\n// in scheduler construction:\nnew CacheScheduler(..., ImmutableMap.of(\n    JdbcExtractionNamespace.class, new JdbcCacheGenerator(...),\n    UriExtractionNamespace.class, new UriCacheGenerator(...),\n    MyCustomNamespace.class, myGenerator));","handlingStrategy":"validation","validationCode":"Set<Class<?>> supported = Set.of(JdbcExtractionNamespace.class, UriExtractionNamespace.class);\nif (!supported.contains(namespace.getClass())) throw new IllegalArgumentException(\"Unsupported namespace type: \" + namespace.getClass());","typeGuard":"boolean schedulable(ExtractionNamespace n) { return n instanceof JdbcExtractionNamespace || n instanceof UriExtractionNamespace; }","tryCatchPattern":"try { return scheduler.schedule(namespace); } catch (IllegalStateException e) { if (e.getMessage().startsWith(\"Cannot find generator for namespace\")) { /* register generator or load extension */ } else { throw e; } }","preventionTips":["Register a CacheGenerator for every custom namespace class","Load the extension module that supports the namespace type"],"tags":["lookup","namespace","registration"],"backgroundTag":"unsupported-operation","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"}