{"record":{"id":"8099c9fcae389f7d","repo":"apache/rocketmq","slug":"failed-to-query-initial-offset","errorCode":null,"errorMessage":"Failed to query initial offset","messagePattern":"Failed to query initial offset","errorType":"exception","errorClass":"RemotingCommandException","httpStatus":null,"severity":"error","filePath":"broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java","lineNumber":912,"sourceCode":"            RequestSource.PROXY_FOR_BROADCAST.getValue(), requestHeader.getRequestSource());\n\n        if (isBroadcast(proxyPullBroadcast, consumerGroupInfo)) {\n            String clientId;\n            if (proxyPullBroadcast) {\n                clientId = requestHeader.getProxyFrowardClientId();\n            } else {\n                ClientChannelInfo clientChannelInfo = consumerGroupInfo.findChannel(channel);\n                if (clientChannelInfo == null) {\n                    return -1;\n                }\n                clientId = clientChannelInfo.getClientId();\n            }\n\n            try {\n                return this.brokerController.getBroadcastOffsetManager()\n                    .queryInitOffset(topic, group, queueId, clientId, requestHeader.getQueueOffset(), proxyPullBroadcast);\n            } catch (ConsumeQueueException e) {\n                throw new RemotingCommandException(\"Failed to query initial offset\", e);\n            }\n        }\n        return -1L;\n    }\n}\n","sourceCodeStart":894,"sourceCodeEnd":918,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java#L894-L918","documentation":"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.","triggerScenarios":"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.","commonSituations":"Broadcast consumer (e.g., MessageModel=BROADCASTING or proxy broadcast pull) connecting right after broker start before store load finishes; damaged consume queue files.","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (RemotingCommandException e) { if (e.getCause() instanceof ConsumeQueueException) { delayFirstBroadcastPull(); retry(); } else throw e; }","preventionTips":["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."],"tags":["rocketmq","broker","pull","broadcast-consumer","offset","consume-queue","storage"],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}