t8y2/dbx · error
unknown method: %s
Error message
unknown method: %s
What it means
handle()'s default branch returns 'unknown method: %s' when the method name matches neither a supported v2 method nor an etcd3-only method. This is a dispatch-level typo/protocol error: the server has no handler for the given name at all.
Source
Thrown at agents/drivers/etcd2-go/main.go:390
case "etcd_auth_role_add":
return s.authRoleAdd(params)
case "etcd_auth_role_delete":
return s.authRoleDelete(params)
case "etcd_auth_role_grant_permission":
return s.authRolePermission(params, true)
case "etcd_auth_role_revoke_permission":
return s.authRolePermission(params, false)
case "disconnect":
s.close()
return map[string]bool{"ok": true}, nil
case "shutdown":
s.close()
return map[string]bool{"ok": true}, nil
default:
if isEtcd3OnlyMethod(method) {
return nil, fmt.Errorf("ETCD_V2_UNSUPPORTED: %s is not available on the etcd v2 API", method)
}
return nil, fmt.Errorf("unknown method: %s", method)
}
}
func isEtcd3OnlyMethod(method string) bool {
switch method {
case "kv_history", "etcd_compact", "etcd_defrag",
"etcd_lease_list", "etcd_lease_get", "etcd_lease_grant",
"etcd_lease_keepalive_once", "etcd_lease_revoke":
return true
}
return false
}
func decodeParams(params map[string]json.RawMessage, target any) error {
if params == nil {
params = map[string]json.RawMessage{}
}
data, err := json.Marshal(params)View on GitHub (pinned to c0390bff16)
Solutions
- Check the method name against the switch cases in handle() in agents/drivers/etcd2-go/main.go.
- Fix casing/typos — method names are exact, lowercase snake_case strings.
- Align client and driver versions so both speak the same method set.
Example fix
// before handle(session, "kv_Put", params) // after handle(session, "kv_put", params)
Defensive patterns
Strategy: validation
Validate before calling
var knownMethods = map[string]bool{"connect": true, "kv_put": true, "kv_get": true /* ...see handle() switch */}
if !knownMethods[method] { return fmt.Errorf("method %q not in etcd2 method set", method) } Type guard
func methodKnown(m string) bool { return knownMethods[m] || isEtcd3OnlyMethod(m) } Try / catch
if err := handle(session, method, params); err != nil && strings.Contains(err.Error(), "unknown method") {
return fmt.Errorf("check method spelling/version: %w", err)
} Prevention
- Keep client method names in a shared constant set mirroring handle()'s switch
- Use lowercase snake_case exactly as defined
- Pin client and driver versions together
When it happens
Trigger: Calling handle() (or the RPC endpoint) with a misspelled method like 'kv_pu' or 'kvPut', or a method from a different/newer protocol revision the driver doesn't implement.
Common situations: Typos in client code, case-sensitivity mistakes, version skew where a newer client sends methods an older v2 driver lacks.
Related errors
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/dae60e05b54fad9f.
Report an issue: GitHub.