apache/rocketmq · error · RemotingCommandException
Failed to query initial offset
Error message
Failed to query initial offset
What it means
PullMessageProcessor.queryBroadcastPullInitOffset delegates to BroadcastOffsetManager.queryInitOffset (first pull of a broadcast group on a queue); a ConsumeQueueException from computing the initial broadcast offset is wrapped as RemotingCommandException, failing the PULL_MESSAGE request.
Source
Thrown at broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java:912
RequestSource.PROXY_FOR_BROADCAST.getValue(), requestHeader.getRequestSource());
if (isBroadcast(proxyPullBroadcast, consumerGroupInfo)) {
String clientId;
if (proxyPullBroadcast) {
clientId = requestHeader.getProxyFrowardClientId();
} else {
ClientChannelInfo clientChannelInfo = consumerGroupInfo.findChannel(channel);
if (clientChannelInfo == null) {
return -1;
}
clientId = clientChannelInfo.getClientId();
}
try {
return this.brokerController.getBroadcastOffsetManager()
.queryInitOffset(topic, group, queueId, clientId, requestHeader.getQueueOffset(), proxyPullBroadcast);
} catch (ConsumeQueueException e) {
throw new RemotingCommandException("Failed to query initial offset", e);
}
}
return -1L;
}
}
View on GitHub (pinned to 293f588571)
Solutions
- Delay the broadcast consumer's first pull until broker startup logs show the store fully loaded.
- Verify consume queue health for the topic (mqAdmin topicStatus offsets are readable).
- Repair/rebuild the store if the wrapped ConsumeQueueException persists, then have the consumer reconnect.
Defensive patterns
Strategy: retry
Try / catch
catch (RemotingCommandException e) { if (e.getCause() instanceof ConsumeQueueException) { delayFirstBroadcastPull(); retry(); } else throw e; } Prevention
- Start broadcast consumers only against brokers reporting healthy/started state.
- Keep broadcast groups' consume queues healthy; broadcast init offset depends on readable min/max offsets.
When it happens
Trigger: First broadcast-mode pull for a group/queue when the broker cannot read min/max offsets from the consume queue to derive the init offset.
Common situations: Broadcast consumer (e.g., MessageModel=BROADCASTING or proxy broadcast pull) connecting right after broker start before store load finishes; damaged consume queue files.
Related errors
- Failed to get max offset
- Failed tp get max offset in queue
- Failed to get max consume offset
- Failed to get max offset in queue or iterate in queue
- Failed to get max offset in queue
AI-assisted analysis of apache/rocketmq@293f588571 (2026-08-14).
Data as JSON: /api/errors/8099c9fcae389f7d.
Report an issue: GitHub.