{"record":{"id":"da51d4cdac8d7366","repo":"t8y2/dbx","slug":"unknown-method-s-da51d4","errorCode":null,"errorMessage":"unknown method: %s","messagePattern":"unknown method: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/etcd-go/main.go","lineNumber":432,"sourceCode":"\t\treturn s.authRoleList(params)\n\tcase \"etcd_auth_role_get\":\n\t\treturn s.authRoleGet(params)\n\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\treturn nil, fmt.Errorf(\"unknown method: %s\", method)\n\t}\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)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn json.Unmarshal(data, target)\n}\n\nfunc stringParam(params map[string]json.RawMessage, key string) string {\n\tif params == nil {\n\t\treturn \"\"\n\t}","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/etcd-go/main.go#L414-L450","documentation":"The JSON-RPC style dispatcher in the etcd agent's handle method received a method name that has no case in its switch. Only a fixed set of method strings is supported; anything else is rejected. This is a client-side protocol/typo problem, not an etcd failure.","triggerScenarios":"Sending a request whose method string does not exactly match one of the supported cases (e.g. 'put', 'get', 'watch', 'close', 'shutdown', ...) — case-sensitive match required.","commonSituations":"Typos or wrong casing in the method name ('Get' vs 'get'); calling a method from the etcd2 agent that only exists in the etcd3 agent (or vice versa); version drift between client and agent; generic wrappers dispatching dynamically-built names.","solutions":["Compare the method string against the agent's supported switch cases and fix the typo/casing","Check which agent driver (etcd-go vs etcd2-go) you are talking to — method sets differ","Upgrade client and agent together if the method was added in a newer version"],"exampleFix":"// before\nagent.call(\"Watch\", params) // wrong casing\n\n// after\nagent.call(\"watch\", params) // exact match against the handle switch","handlingStrategy":"validation","validationCode":"var supportedMethods = map[string]bool{\"connect\":true,\"get\":true,\"put\":true,\"delete\":true,\"watch\":true,\"close\":true,\"shutdown\":true /* ...match the handle switch */}\nfunc validMethod(m string) bool { return supportedMethods[m] }","typeGuard":null,"tryCatchPattern":"resp, err := agent.Call(method, params)\nif err != nil && strings.Contains(err.Error(), \"unknown method\") {\n    return fmt.Errorf(\"method %q not supported by this agent driver: %w\", method, err)\n}","preventionTips":["Keep a shared constant list of method names between client and agent","Verify the target driver (etcd-go vs etcd2-go) supports the method","Version-gate new methods on both sides"],"tags":["go","rpc","protocol","unknown-method"],"backgroundTag":"unknown-rpc-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"}