t8y2/dbx · error
unknown method: %s
Error message
unknown method: %s
What it means
The agent's dispatch table routes an incoming JSON-RPC-style method name to its handler; any name not present in the switch (e.g. must start with the mq_ family) falls through to this error. It means the caller invoked a method this RocketMQ driver does not implement.
Source
Thrown at agents/drivers/rocketmq/server.go:115
return a.viewMessage(params)
case "mq_query_message_by_key":
return a.queryMessageByKey(params)
case "mq_query_message_by_topic":
return a.queryMessageByTopic(params)
case "mq_query_message_trace":
return a.queryMessageTrace(params)
case "mq_send_message":
return a.sendMessage(params)
case "mq_list_acls":
return a.listACLs(params)
case "mq_create_acls":
return a.createACLs(params)
case "mq_delete_acls":
return a.deleteACLs(params)
case "mq_describe_cluster":
return a.describeCluster(params)
default:
return nil, fmt.Errorf("unknown method: %s", method)
}
}
func (a *rocketMQAgent) requireClient() (*admin.Client, connectionConfig, error) {
a.mu.RLock()
defer a.mu.RUnlock()
if a.client == nil {
return nil, connectionConfig{}, errors.New("RocketMQ agent is not connected")
}
return a.client, a.connection, nil
}
func (a *rocketMQAgent) close() {
a.mu.Lock()
defer a.mu.Unlock()
if a.client != nil {
_ = a.client.Close()
}View on GitHub (pinned to c0390bff16)
Solutions
- Check the exact method name against the switch cases in server.go dispatch (spelling, casing, mq_ prefix)
- List available methods by reading the dispatch switch or the driver's documentation for this version
- Update the client/test to the renamed method if the driver version changed
- If the method should exist, add a case in dispatch wired to a handler
Example fix
// before result, err := agent.Call(ctx, "mq_cluster_describe", params) // after result, err := agent.Call(ctx, "mq_describe_cluster", params)
Defensive patterns
Strategy: validation
Validate before calling
var knownMethods = map[string]bool{"mq_create_acls":true,"mq_delete_acls":true,"mq_describe_cluster":true /* ...all dispatch cases */}
if !knownMethods[method] {
return fmt.Errorf("method %q not supported by this driver", method)
} Try / catch
res, err := agent.Call(ctx, method, params)
if err != nil && strings.HasPrefix(err.Error(), "unknown method:") {
// log supported methods / fix client method name
} Prevention
- Keep a generated list of supported method names in the client SDK
- Use constants/enums for method names instead of raw strings
- Add integration tests covering every dispatch case (see TestDispatchRejectsInvalidParamsAndUnknownMethods)
- Grep the dispatch switch when upgrading driver versions for renamed methods
When it happens
Trigger: Calling the agent with a method string not in the switch: a typo like 'mq_describe_cluster ' with trailing whitespace, wrong casing, a method from a different driver (e.g. kafka-specific names), or a method removed/renamed in this version.
Common situations: Typos or wrong casing in the method name; copying method names from another agent driver; version drift where a test or client uses a method name that was renamed; missing driver registration in main.
Related errors
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/40758c7ea66ab608.
Report an issue: GitHub.