t8y2/dbx · error · IllegalArgumentException
Unknown method: {method}
Error message
Unknown method: {method} What it means
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.
Source
Thrown at agents/common/src/main/java/com/dbx/agent/JsonRpcServer.java:337
Type statementsType = new TypeToken<List<String>>() {}.getType();
List<String> statements = gson.fromJson(params.get("statements"), statementsType);
return agent.executeBatch(statements, stringOrNull(params, "schema"));
}
if (AgentProtocol.METHOD_DISCONNECT.equals(method)) {
jdbcExecutor.closeAllQuerySessions();
jdbcExecutor.closeAllTableReadSessions();
agent.disconnect();
lastConnectParams = null;
return Collections.singletonMap("ok", true);
}
if (AgentProtocol.METHOD_SHUTDOWN.equals(method)) {
jdbcExecutor.closeAllQuerySessions();
jdbcExecutor.closeAllTableReadSessions();
agent.disconnect();
lastConnectParams = null;
return Collections.singletonMap("ok", true);
}
throw new IllegalArgumentException("Unknown method: " + method);
}
private void switchCatalog(JsonObject params) throws Exception {
String database = stringOrNull(params, "database");
if (database != null && !database.trim().isEmpty() && agent.getConnection() != null) {
String currentCatalog = null;
try {
currentCatalog = agent.getConnection().getCatalog();
} catch (Exception ignored) {
}
if (currentCatalog == null || !currentCatalog.trim().equalsIgnoreCase(database.trim())) {
try {
agent.getConnection().setCatalog(database);
} catch (Exception ignored) {
}
}
}
}View on GitHub (pinned to c0390bff16)
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
Example fix
// before
rpc.call("executeQuery"); // typo / unsupported
// after
rpc.call("jdbc.executeSql"); // method defined in AgentProtocol for this agent version Defensive patterns
Strategy: type-guard
Validate before calling
// client-side allowlist mirroring AgentProtocol
Set<String> supported = Set.of("connect","disconnect","testConnection","validateConnection","connectionInfo", ...);
if (!supported.contains(method)) throw new UnsupportedOperationException(method); Type guard
boolean isSupportedMethod(String m) { return AgentProtocol.ALL_METHODS.contains(m); } Try / catch
try {
return rpc.call(method, params);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Unknown method")) {
return fallbackRpc.call(method, params); // newer agent version
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/4db26709b962f335.
Report an issue: GitHub.