{"record":{"id":"6eb148780143e3bb","repo":"t8y2/dbx","slug":"unknown-method-s-6eb148","errorCode":null,"errorMessage":"unknown method: %s","messagePattern":"unknown method: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/xugu/main.go","lineNumber":1239,"sourceCode":"\t\tif err := s.useDatabase(stringParam(params, \"database\")); err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\t\tresult, err := s.listSubpartitions(stringParam(params, \"schema\"), stringParam(params, \"table\"))\n\t\treturn result, false, err\n\tcase \"get_explain_info\":\n\t\tsqlText := stringParam(params, \"sql\")\n\t\tplan, err := s.getExplainInfo(sqlText)\n\t\treturn map[string]any{\"plan\": plan, \"has_actual_stats\": false}, false, err\n\tcase \"execute_transaction\":\n\t\tresult, err := s.executeTransaction(params)\n\t\treturn result, false, err\n\tcase \"disconnect\":\n\t\treturn map[string]bool{\"ok\": true}, false, s.disconnect()\n\tcase \"shutdown\":\n\t\t_ = s.disconnect()\n\t\treturn map[string]bool{\"ok\": true}, true, nil\n\tdefault:\n\t\treturn nil, false, fmt.Errorf(\"unknown method: %s\", method)\n\t}\n}\n\nfunc (s *server) connect(params connectParams) error {\n\tif !xuguControlSessionEligible(params) {\n\t\t_, err := s.connectWithControl(params, nil, false)\n\t\treturn err\n\t}\n\tcancelParams := xuguControlParams(params)\n\tcancelDB, err := openDB(cancelParams)\n\tif err != nil {\n\t\t_, err = s.connectWithControl(params, nil, false)\n\t\treturn err\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)\n\tdefer cancel()\n\tif err := cancelDB.PingContext(ctx); err != nil {\n\t\tcancelDB.Close()","sourceCodeStart":1221,"sourceCodeEnd":1257,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/xugu/main.go#L1221-L1257","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nrpc.Call(\"fetch_query_Page\", ...) // typo\n// after\nrpc.Call(\"fetch_query_page\", ...)","handlingStrategy":"validation","validationCode":"var validMethods = map[string]bool{\"connect\":true,\"disconnect\":true,\"shutdown\":true,\"fetch_query_page\":true}\nif !validMethods[method] {\n  return fmt.Errorf(\"method %q not supported by this agent\", method)\n}","typeGuard":null,"tryCatchPattern":"if err := rpc.Call(method); err != nil {\n  if strings.HasPrefix(err.Error(), \"unknown method:\") {\n    log.Fatalf(\"agent does not implement %s; check version alignment\", method)\n  }\n}","preventionTips":["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."],"tags":["rpc","protocol","unknown-method","version-mismatch"],"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"}