{"record":{"id":"2d53fc296ea61095","repo":"t8y2/dbx","slug":"unknown-method-method-2d53fc","errorCode":null,"errorMessage":"Unknown method: \" + method","messagePattern":"Unknown method: \" \\+ method","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java","lineNumber":164,"sourceCode":"            case \"mq_alter_topic_config\" -> alterTopicConfig(params);\n            // Consumer groups\n            case \"mq_list_consumer_groups\" -> listConsumerGroups(params);\n            case \"mq_get_consumer_group_snapshot\" -> getConsumerGroupSnapshot(params);\n            case \"mq_describe_consumer_group\" -> describeConsumerGroup(params);\n            case \"mq_delete_consumer_group\" -> deleteConsumerGroup(params);\n            case \"mq_reset_consumer_group_offsets\" -> resetConsumerGroupOffsets(params);\n            case \"mq_list_producers\" -> listProducers(params);\n            // Messages\n            case \"mq_peek_messages\" -> peekMessages(params);\n            case \"mq_send_message\" -> sendMessage(params);\n            // ACLs\n            case \"mq_list_acls\" -> listAcls(params);\n            case \"mq_create_acls\" -> createAcls(params);\n            case \"mq_delete_acls\" -> deleteAcls(params);\n            // Cluster / monitoring\n            case \"mq_describe_cluster\" -> describeCluster(params);\n            case \"mq_get_consumer_lag\" -> getConsumerLag(params);\n            default -> throw new IllegalArgumentException(\"Unknown method: \" + method);\n        };\n    }\n\n    // -----------------------------------------------------------------------\n    // Lifecycle\n    // -----------------------------------------------------------------------\n\n    private static Object handshakeResult() {\n        return new HandshakeResult(1, 1, CAPABILITIES);\n    }\n\n    private static Object connect(JsonObject params) throws Exception {\n        JsonObject conn = resolveBrokerConnection(connectionObject(params));\n        Map<String, String> previousKerberosSystemProperties = applyKerberosSystemProperties(conn);\n        AdminClient nextAdmin = null;\n        KafkaProducer<String, byte[]> nextProducer = null;\n        try {\n            nextAdmin = buildAdminClient(conn);","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java#L146-L182","documentation":"KafkaAgent.dispatch routes an RPC method name to a handler via a switch over known mq_* methods. If the requested method is not one of the implemented operations, the default branch throws IllegalArgumentException listing the unknown method name.","triggerScenarios":"Invoking the agent's result()/dispatch() with a method string that is not in the supported mq_* set (typo, unsupported op, method from a newer client against an older agent).","commonSituations":"Typo like 'mq_listAcls' vs 'mq_list_acls'; client and agent version skew (new mq_* method not present in deployed agent); dynamically built method names from config.","solutions":["Use one of the supported method names exactly as defined in the dispatch switch (snake_case, mq_ prefix)","Check the agent version — if the method exists in a newer release, upgrade the deployed agent","Log/inspect the method value being sent; validate the method list client-side against the agent's supported operations"],"exampleFix":"// before\nagent.result(Map.of(\"method\", \"mq_listTopicAcls\", \"params\", ...));\n// after\nagent.result(Map.of(\"method\", \"mq_list_acls\", \"params\", ...));","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"mq_list_acls\",\"mq_create_acls\",\"mq_delete_acls\",\"mq_describe_cluster\",\"mq_get_consumer_lag\" /* ... */);\nif (!supported.contains(method)) throw new IllegalArgumentException(\"unsupported method: \" + method);","typeGuard":null,"tryCatchPattern":"try {\n    return agent.result(params);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unknown method:\")) {\n        // surface allowed method list to the caller\n    }\n    throw e;\n}","preventionTips":["Keep client-side method constants in sync with the agent's dispatch switch","Pin client and agent to compatible versions","Use an enum or generated constant list for method names instead of free-form strings"],"tags":["kafka","rpc","illegal-argument","api"],"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-14T00:17:10.932Z"}