t8y2/dbx · error
unknown method: %s
Error message
unknown method: %s
What it means
The agent's RPC dispatcher accepts a fixed set of method names (connect, disconnect, shutdown, fetch_query_page, etc.). Any unrecognized method string returns 'unknown method: <method>'. This is a protocol-level rejection indicating client and agent disagree on the RPC surface.
Source
Thrown at agents/drivers/xugu/main.go:1239
if err := s.useDatabase(stringParam(params, "database")); err != nil {
return nil, false, err
}
result, err := s.listSubpartitions(stringParam(params, "schema"), stringParam(params, "table"))
return result, false, err
case "get_explain_info":
sqlText := stringParam(params, "sql")
plan, err := s.getExplainInfo(sqlText)
return map[string]any{"plan": plan, "has_actual_stats": false}, false, err
case "execute_transaction":
result, err := s.executeTransaction(params)
return result, false, err
case "disconnect":
return map[string]bool{"ok": true}, false, s.disconnect()
case "shutdown":
_ = s.disconnect()
return map[string]bool{"ok": true}, true, nil
default:
return nil, false, fmt.Errorf("unknown method: %s", method)
}
}
func (s *server) connect(params connectParams) error {
if !xuguControlSessionEligible(params) {
_, err := s.connectWithControl(params, nil, false)
return err
}
cancelParams := xuguControlParams(params)
cancelDB, err := openDB(cancelParams)
if err != nil {
_, err = s.connectWithControl(params, nil, false)
return err
}
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
if err := cancelDB.PingContext(ctx); err != nil {
cancelDB.Close()View on GitHub (pinned to c0390bff16)
Solutions
- Fix the method name to one the agent supports (check the dispatcher's case list).
- Upgrade the agent binary to match the client's protocol version if the method is newer.
- Align/downgrade the client library with the deployed agent version.
- Log the exact method string sent and compare against the supported list.
Example fix
// before
rpc.Call("fetch_query_Page", ...) // typo
// after
rpc.Call("fetch_query_page", ...) Defensive patterns
Strategy: validation
Validate before calling
var validMethods = map[string]bool{"connect":true,"disconnect":true,"shutdown":true,"fetch_query_page":true}
if !validMethods[method] {
return fmt.Errorf("method %q not supported by this agent", method)
} Try / catch
if err := rpc.Call(method); err != nil {
if strings.HasPrefix(err.Error(), "unknown method:") {
log.Fatalf("agent does not implement %s; check version alignment", method)
}
} Prevention
- Keep client library and agent binary versions in lockstep.
- Define method names as constants, never inline strings.
- Check the protocol/version handshake before calling newer methods.
- Test RPC method names against the dispatcher's supported list.
When it happens
Trigger: Sending an RPC request whose method name is not in the dispatcher's switch — a typo, a method from a newer/older protocol version, or a driver-only method invoked over the wire.
Common situations: Client library and agent binary version mismatch (client calls a method the agent does not implement); hand-rolled RPC scripts with misspelled names; copying method names from documentation of a different driver.
Related errors
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/6eb148780143e3bb.
Report an issue: GitHub.