{"record":{"id":"dae60e05b54fad9f","repo":"t8y2/dbx","slug":"unknown-method-s-dae60e","errorCode":null,"errorMessage":"unknown method: %s","messagePattern":"unknown method: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/etcd2-go/main.go","lineNumber":390,"sourceCode":"\tcase \"etcd_auth_role_add\":\n\t\treturn s.authRoleAdd(params)\n\tcase \"etcd_auth_role_delete\":\n\t\treturn s.authRoleDelete(params)\n\tcase \"etcd_auth_role_grant_permission\":\n\t\treturn s.authRolePermission(params, true)\n\tcase \"etcd_auth_role_revoke_permission\":\n\t\treturn s.authRolePermission(params, false)\n\tcase \"disconnect\":\n\t\ts.close()\n\t\treturn map[string]bool{\"ok\": true}, nil\n\tcase \"shutdown\":\n\t\ts.close()\n\t\treturn map[string]bool{\"ok\": true}, nil\n\tdefault:\n\t\tif isEtcd3OnlyMethod(method) {\n\t\t\treturn nil, fmt.Errorf(\"ETCD_V2_UNSUPPORTED: %s is not available on the etcd v2 API\", method)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"unknown method: %s\", method)\n\t}\n}\n\nfunc isEtcd3OnlyMethod(method string) bool {\n\tswitch method {\n\tcase \"kv_history\", \"etcd_compact\", \"etcd_defrag\",\n\t\t\"etcd_lease_list\", \"etcd_lease_get\", \"etcd_lease_grant\",\n\t\t\"etcd_lease_keepalive_once\", \"etcd_lease_revoke\":\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc decodeParams(params map[string]json.RawMessage, target any) error {\n\tif params == nil {\n\t\tparams = map[string]json.RawMessage{}\n\t}\n\tdata, err := json.Marshal(params)","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/etcd2-go/main.go#L372-L408","documentation":"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.","triggerScenarios":"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.","commonSituations":"Typos in client code, case-sensitivity mistakes, version skew where a newer client sends methods an older v2 driver lacks.","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."],"exampleFix":"// before\nhandle(session, \"kv_Put\", params)\n// after\nhandle(session, \"kv_put\", params)","handlingStrategy":"validation","validationCode":"var knownMethods = map[string]bool{\"connect\": true, \"kv_put\": true, \"kv_get\": true /* ...see handle() switch */}\nif !knownMethods[method] { return fmt.Errorf(\"method %q not in etcd2 method set\", method) }","typeGuard":"func methodKnown(m string) bool { return knownMethods[m] || isEtcd3OnlyMethod(m) }","tryCatchPattern":"if err := handle(session, method, params); err != nil && strings.Contains(err.Error(), \"unknown method\") {\n    return fmt.Errorf(\"check method spelling/version: %w\", err)\n}","preventionTips":["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"],"tags":["etcd","rpc","unknown-method"],"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"}