apache/druid · error · IllegalStateException
Don't query me, bro.
Error message
Don't query me, bro.
What it means
StreamAppenderator.getQueryRunnerForIntervals throws IllegalStateException("Don't query me, bro.") when the appenderator's queryRunnerFactoryCollaborator (texasRanger) was never initialized — i.e., the appenderator is not wired into a query infrastructure. The appenderator itself is not queryable until initialized with query support.
Solutions
- Query segments via the task's QueryableDruidServer/QueryLifecycle instead of the appenderator directly.
- Initialize the appenderator with a QueryRunnerFactoryCollaborator if in-process querying is intended.
- Ensure stop() was not called before issuing queries.
Example fix
// before appenderator.getQueryRunnerForIntervals(query, intervals); // texasRanger null // after QueryRunner<T> runner = queryLifecycle.run(query) // or wire collaborator at appenderator construction
Defensive patterns
Strategy: validation
Validate before calling
// only query through the appenderator if it was initialized with query support
if (!appenderatorSupportsQueries(config)) { throw new UnsupportedOperationException("use task query path"); } Try / catch
try { return runnerFactory.getRunner(...) } catch (IllegalStateException e) { if (e.getMessage().equals("Don't query me, bro.")) { return queryViaTaskApi(query); } throw e; } Prevention
- Never query an Appenderator directly in custom pipelines
- Route queries via broker or task's query runner
- Don't reuse an appenderator after stop()
When it happens
Trigger: Calling getQueryRunnerForIntervals on an appenderator created without queryRunnerFactoryCollaborator (e.g. BatchAppenderator or tasks that never register a query runner factory), or after stop() clearing the collaborator.
Common situations: Embedding an appenderator in custom ingestion code and attempting to query it directly without registering query runner factories; querying a task's segments through the wrong component.
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
- Query type ' ' does not support returning results as arrays
- Aggregator[ ] cannot vectorize
- AppenderatorsManager methods should only called by services…
- ApproximateHistogramBufferAggregator does not support…
- ApproximateHistogramBufferAggregator does not support…
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/5ab456a28ec80e63.
Report an issue: GitHub.
Appendix: source
Thrown at server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:546
try {
segmentAnnouncer.announceSegment(retVal.getSegment());
}
catch (IOException e) {
log.makeAlert(e, "Failed to announce new segment[%s]", schema.getDataSource())
.addData("interval", retVal.getInterval())
.emit();
}
}
return retVal;
}
@Override
public <T> QueryRunner<T> getQueryRunnerForIntervals(final Query<T> query, final Iterable<Interval> intervals)
{
if (texasRanger == null) {
throw new IllegalStateException("Don't query me, bro.");
}
return texasRanger.getQueryRunnerForIntervals(query, intervals);
}
@Override
public <T> QueryRunner<T> getQueryRunnerForSegments(final Query<T> query, final Iterable<SegmentDescriptor> specs)
{
if (texasRanger == null) {
throw new IllegalStateException("Don't query me, bro.");
}
return texasRanger.getQueryRunnerForSegments(query, specs);
}
@Override
public void clear() throws InterruptedException
{View on GitHub (pinned to 9b90983fd2)