{"record":{"id":"40758c7ea66ab608","repo":"t8y2/dbx","slug":"unknown-method-s-40758c","errorCode":null,"errorMessage":"unknown method: %s","messagePattern":"unknown method: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/rocketmq/server.go","lineNumber":115,"sourceCode":"\t\treturn a.viewMessage(params)\n\tcase \"mq_query_message_by_key\":\n\t\treturn a.queryMessageByKey(params)\n\tcase \"mq_query_message_by_topic\":\n\t\treturn a.queryMessageByTopic(params)\n\tcase \"mq_query_message_trace\":\n\t\treturn a.queryMessageTrace(params)\n\tcase \"mq_send_message\":\n\t\treturn a.sendMessage(params)\n\tcase \"mq_list_acls\":\n\t\treturn a.listACLs(params)\n\tcase \"mq_create_acls\":\n\t\treturn a.createACLs(params)\n\tcase \"mq_delete_acls\":\n\t\treturn a.deleteACLs(params)\n\tcase \"mq_describe_cluster\":\n\t\treturn a.describeCluster(params)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown method: %s\", method)\n\t}\n}\n\nfunc (a *rocketMQAgent) requireClient() (*admin.Client, connectionConfig, error) {\n\ta.mu.RLock()\n\tdefer a.mu.RUnlock()\n\tif a.client == nil {\n\t\treturn nil, connectionConfig{}, errors.New(\"RocketMQ agent is not connected\")\n\t}\n\treturn a.client, a.connection, nil\n}\n\nfunc (a *rocketMQAgent) close() {\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\tif a.client != nil {\n\t\t_ = a.client.Close()\n\t}","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/rocketmq/server.go#L97-L133","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nresult, err := agent.Call(ctx, \"mq_cluster_describe\", params)\n// after\nresult, err := agent.Call(ctx, \"mq_describe_cluster\", params)","handlingStrategy":"validation","validationCode":"var knownMethods = map[string]bool{\"mq_create_acls\":true,\"mq_delete_acls\":true,\"mq_describe_cluster\":true /* ...all dispatch cases */}\nif !knownMethods[method] {\n    return fmt.Errorf(\"method %q not supported by this driver\", method)\n}","typeGuard":null,"tryCatchPattern":"res, err := agent.Call(ctx, method, params)\nif err != nil && strings.HasPrefix(err.Error(), \"unknown method:\") {\n    // log supported methods / fix client method name\n}","preventionTips":["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"],"tags":["rpc","rocketmq","unknown-method","api-misuse"],"backgroundTag":"unknown-method","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"}