apache/druid · error · UOE

AppenderatorsManager methods should only called by services

Error message

AppenderatorsManager methods should only called by services that run tasks directly.

What it means

DummyForInjectionAppenderatorsManager is a stub AppenderatorsManager whose every method throws UnsupportedOperationException. It exists only as an injection placeholder (e.g. for Peons in non-task mode) and must never be used to create realtime appenderators. This error means a service running tasks directly is absent — the wrong manager was injected into a component that expected a real manager (like UsedAppenderatorsManager or TaskAppenderatorsManager).

Source

Thrown at server/src/main/java/org/apache/druid/segment/realtime/appenderator/DummyForInjectionAppenderatorsManager.java:86

      ObjectMapper objectMapper,
      IndexIO indexIO,
      IndexMerger indexMerger,
      QueryRunnerFactoryConglomerate conglomerate,
      DataSegmentAnnouncer segmentAnnouncer,
      ServiceEmitter emitter,
      QueryProcessingPool queryProcessingPool,
      JoinableFactory joinableFactory,
      Cache cache,
      CacheConfig cacheConfig,
      CachePopulatorStats cachePopulatorStats,
      PolicyEnforcer policyEnforcer,
      RowIngestionMeters rowIngestionMeters,
      ParseExceptionHandler parseExceptionHandler,
      CentralizedDatasourceSchemaConfig centralizedDatasourceSchemaConfig,
      TaskIntervalUnlocker taskIntervalUnlocker
  )
  {
    throw new UOE(ERROR_MSG);
  }

  @Override
  public Appenderator createBatchAppenderatorForTask(
      String taskId,
      DataSchema schema,
      AppenderatorConfig config,
      TaskDirectory taskDirectory,
      SegmentGenerationMetrics metrics,
      DataSegmentPusher dataSegmentPusher,
      ObjectMapper objectMapper,
      IndexIO indexIO,
      IndexMerger indexMerger,
      RowIngestionMeters rowIngestionMeters,
      ParseExceptionHandler parseExceptionHandler,
      CentralizedDatasourceSchemaConfig centralizedDatasourceSchemaConfig
  )
  {

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Ensure the code path runs only in a service that executes tasks directly (Peon); restructure so task-side components get TaskAppenderatorsManager
  2. Fix the Guice binding to install the appropriate AppenderatorsManager for the runtime mode
  3. If in a test, inject a real or mock AppenderatorsManager instead of the dummy

Example fix

// before
this.appenderatorsManager = injector.getInstance(AppenderatorsManager.class); // resolves dummy
// after
this.appenderatorsManager = injector.getInstance(TaskAppenderatorsManager.class); // real task-side manager
Defensive patterns

Strategy: type-guard

Validate before calling

if (appenderatorsManager instanceof DummyForInjectionAppenderatorsManager) {
  throw new IllegalStateException("Realtime appenderators unsupported in this runtime");
}

Type guard

boolean supportsTaskAppenderators(AppenderatorsManager m) {
  return !(m instanceof DummyForInjectionAppenderatorsManager);
}

Try / catch

try {
  appenderatorsManager.createRealtimeAppenderatorForTask(...);
} catch (UOE e) {
  throw new IllegalStateException("Not running in a task-executing service; cannot create realtime appenderator", e);
}

Prevention

When it happens

Trigger: Calling createRealtimeAppenderatorForTask on a DummyForInjectionAppenderatorsManager instance obtained from DI — typically when a component that should only run under the task runner receives the dummy binding because the runtime mode does not run tasks directly.

Common situations: Misconfigured Guice injection in tests or embedded setups; running code paths intended for Middle Manager/Peon environments where the dummy binding is active; upgrading Druid and adding a component that assumes a real AppenderatorsManager binding.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/ea58239e4f713fc5. Report an issue: GitHub.