t8y2/dbx · error
no RocketMQ master broker found for topic %s
Error message
no RocketMQ master broker found for topic %s
What it means
readConsumerStatusFromBrokers requires at least one master broker address for the topic before issuing GetConsumerStatus requests; an empty address list means no master broker is serving the topic, so it errors with the topic name.
Source
Thrown at agents/drivers/rocketmq/consumers.go:322
route, err := r.client.ExamineTopicRouteInfo(ctx, topic)
if err != nil {
return nil, err
}
return readConsumerStatusFromBrokers(
ctx, masterAddressesFromRoute(route), topic, groupID, clientAddr, r.invoke,
)
}
func readConsumerStatusFromBrokers(
ctx context.Context,
addresses []string,
topic string,
groupID string,
clientAddr string,
invoke consumerStatusInvoker,
) (map[string]map[string]int64, error) {
if len(addresses) == 0 {
return nil, fmt.Errorf("no RocketMQ master broker found for topic %s", topic)
}
orderedAddresses := append([]string(nil), addresses...)
sort.Strings(orderedAddresses)
merged := make(map[string]map[string]int64)
successCount := 0
var lastErr error
for _, address := range orderedAddresses {
fields := map[string]string{"topic": topic, "group": groupID}
if clientAddr != "" {
fields["clientAddr"] = clientAddr
}
response, requestErr := invoke(ctx, address,
remoting.NewRequest(remoting.InvokeBrokerToGetConsumerStatus, fields))
if requestErr != nil {
lastErr = requestErr
continue
}
if response == nil {View on GitHub (pinned to c0390bff16)
Solutions
- Verify the topic exists and has queues on a master broker (mqadmin topicRoute)
- Ensure the master broker for the topic is running and reachable
- Double-check the topic spelling and cluster you are querying
Example fix
// before GetConsumeStatus(ctx, "topik-name", "group") // typo'd topic, no route // after GetConsumeStatus(ctx, "topic-name", "group") // existing topic with master route
Defensive patterns
Strategy: validation
Validate before calling
route, err := adminClient.FetchTopicRoute(topic)
if err != nil || len(route) == 0 {
return fmt.Errorf("topic %s has no route/master broker; check topic exists", topic)
} Type guard
func hasMasterForTopic(route []brokerInfo) bool {
for _, b := range route { if b.ReadableQueueNums > 0 { return true } }
return false
} Try / catch
status, err := GetConsumeStatus(ctx, topic, group)
if err != nil && strings.Contains(err.Error(), "no RocketMQ master broker") {
return fmt.Errorf("topic %s not available: deploy topic / start master broker", topic)
} Prevention
- Create topics with writable/readable queues on masters
- Monitor master broker health for key topics
- Validate topic names against a cluster listing before calls
When it happens
Trigger: GetConsumeStatus resolving topic routes yields zero master broker addresses (all brokers are slaves, topic not deployed, or route info empty).
Common situations: Topic created with no queues on a readable master; master broker down while only slaves survive; topic name typo so route lookup returns nothing; name-server metadata stale.
Related errors
- no RocketMQ master broker found for topic %s
- View source not found: " + name
- MongoDB collection '<sourceName>' was not found
- Object source not found
- ETCD_NOT_FOUND
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/b494153896463c0d.
Report an issue: GitHub.