{"record":{"id":"4db26709b962f335","repo":"t8y2/dbx","slug":"unknown-method-method","errorCode":null,"errorMessage":"Unknown method: {method}","messagePattern":"Unknown method: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agents/common/src/main/java/com/dbx/agent/JsonRpcServer.java","lineNumber":337,"sourceCode":"            Type statementsType = new TypeToken<List<String>>() {}.getType();\n            List<String> statements = gson.fromJson(params.get(\"statements\"), statementsType);\n            return agent.executeBatch(statements, stringOrNull(params, \"schema\"));\n        }\n        if (AgentProtocol.METHOD_DISCONNECT.equals(method)) {\n            jdbcExecutor.closeAllQuerySessions();\n            jdbcExecutor.closeAllTableReadSessions();\n            agent.disconnect();\n            lastConnectParams = null;\n            return Collections.singletonMap(\"ok\", true);\n        }\n        if (AgentProtocol.METHOD_SHUTDOWN.equals(method)) {\n            jdbcExecutor.closeAllQuerySessions();\n            jdbcExecutor.closeAllTableReadSessions();\n            agent.disconnect();\n            lastConnectParams = null;\n            return Collections.singletonMap(\"ok\", true);\n        }\n        throw new IllegalArgumentException(\"Unknown method: \" + method);\n    }\n\n    private void switchCatalog(JsonObject params) throws Exception {\n        String database = stringOrNull(params, \"database\");\n        if (database != null && !database.trim().isEmpty() && agent.getConnection() != null) {\n            String currentCatalog = null;\n            try {\n                currentCatalog = agent.getConnection().getCatalog();\n            } catch (Exception ignored) {\n            }\n            if (currentCatalog == null || !currentCatalog.trim().equalsIgnoreCase(database.trim())) {\n                try {\n                    agent.getConnection().setCatalog(database);\n                } catch (Exception ignored) {\n                }\n            }\n        }\n    }","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/common/src/main/java/com/dbx/agent/JsonRpcServer.java#L319-L355","documentation":"The catch-all at the end of JsonRpcServer.dispatch throws IllegalArgumentException('Unknown method: {method}') for any JSON-RPC method not matched by the preceding protocol handlers. It signals the client invoked a method this server build does not implement.","triggerScenarios":"Calling a JSON-RPC method name that is misspelled, not part of AgentProtocol, or added only in a newer agent version than the one running.","commonSituations":"Client/server version skew (client expects newer methods); typo in method name; custom tools calling nonstandard method names; case-sensitivity mistakes in the method string.","solutions":["Check the exact method name against AgentProtocol constants supported by the running agent","Upgrade the agent (server) to a version that implements the method your client calls","Log/inspect the method string for typos or casing differences","Add graceful client handling that lists supported methods before invoking"],"exampleFix":"// before\nrpc.call(\"executeQuery\"); // typo / unsupported\n// after\nrpc.call(\"jdbc.executeSql\"); // method defined in AgentProtocol for this agent version","handlingStrategy":"type-guard","validationCode":"// client-side allowlist mirroring AgentProtocol\nSet<String> supported = Set.of(\"connect\",\"disconnect\",\"testConnection\",\"validateConnection\",\"connectionInfo\", ...);\nif (!supported.contains(method)) throw new UnsupportedOperationException(method);","typeGuard":"boolean isSupportedMethod(String m) { return AgentProtocol.ALL_METHODS.contains(m); }","tryCatchPattern":"try {\n    return rpc.call(method, params);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unknown method\")) {\n        return fallbackRpc.call(method, params); // newer agent version\n    }\n    throw e;\n}","preventionTips":["Reference AgentProtocol constants instead of hand-typed method strings","Keep client and agent versions aligned; check agent version at handshake","Add an integration test enumerating every method the client calls","Log unsupported methods to catch typos early"],"tags":["jsonrpc","protocol","unknown-method","version-skew"],"backgroundTag":"unknown-jsonrpc-method","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}