{"record":{"id":"b494153896463c0d","repo":"t8y2/dbx","slug":"no-rocketmq-master-broker-found-for-topic-s","errorCode":null,"errorMessage":"no RocketMQ master broker found for topic %s","messagePattern":"no RocketMQ master broker found for topic (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/rocketmq/consumers.go","lineNumber":322,"sourceCode":"\troute, err := r.client.ExamineTopicRouteInfo(ctx, topic)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn readConsumerStatusFromBrokers(\n\t\tctx, masterAddressesFromRoute(route), topic, groupID, clientAddr, r.invoke,\n\t)\n}\n\nfunc readConsumerStatusFromBrokers(\n\tctx context.Context,\n\taddresses []string,\n\ttopic string,\n\tgroupID string,\n\tclientAddr string,\n\tinvoke consumerStatusInvoker,\n) (map[string]map[string]int64, error) {\n\tif len(addresses) == 0 {\n\t\treturn nil, fmt.Errorf(\"no RocketMQ master broker found for topic %s\", topic)\n\t}\n\torderedAddresses := append([]string(nil), addresses...)\n\tsort.Strings(orderedAddresses)\n\tmerged := make(map[string]map[string]int64)\n\tsuccessCount := 0\n\tvar lastErr error\n\tfor _, address := range orderedAddresses {\n\t\tfields := map[string]string{\"topic\": topic, \"group\": groupID}\n\t\tif clientAddr != \"\" {\n\t\t\tfields[\"clientAddr\"] = clientAddr\n\t\t}\n\t\tresponse, requestErr := invoke(ctx, address,\n\t\t\tremoting.NewRequest(remoting.InvokeBrokerToGetConsumerStatus, fields))\n\t\tif requestErr != nil {\n\t\t\tlastErr = requestErr\n\t\t\tcontinue\n\t\t}\n\t\tif response == nil {","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/rocketmq/consumers.go#L304-L340","documentation":"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.","triggerScenarios":"GetConsumeStatus resolving topic routes yields zero master broker addresses (all brokers are slaves, topic not deployed, or route info empty).","commonSituations":"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.","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"],"exampleFix":"// before\nGetConsumeStatus(ctx, \"topik-name\", \"group\")  // typo'd topic, no route\n// after\nGetConsumeStatus(ctx, \"topic-name\", \"group\")  // existing topic with master route","handlingStrategy":"validation","validationCode":"route, err := adminClient.FetchTopicRoute(topic)\nif err != nil || len(route) == 0 {\n    return fmt.Errorf(\"topic %s has no route/master broker; check topic exists\", topic)\n}","typeGuard":"func hasMasterForTopic(route []brokerInfo) bool {\n    for _, b := range route { if b.ReadableQueueNums > 0 { return true } }\n    return false\n}","tryCatchPattern":"status, err := GetConsumeStatus(ctx, topic, group)\nif err != nil && strings.Contains(err.Error(), \"no RocketMQ master broker\") {\n    return fmt.Errorf(\"topic %s not available: deploy topic / start master broker\", topic)\n}","preventionTips":["Create topics with writable/readable queues on masters","Monitor master broker health for key topics","Validate topic names against a cluster listing before calls"],"tags":["broker","topic","not-found"],"backgroundTag":"no-broker-available","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}