{"record":{"id":"677d6146da3d1fea","repo":"apache/kafka","slug":"transactionalid-transactionalid-was-not-includ","errorCode":null,"errorMessage":"TransactionalId `{transactionalId}` was not included in the request","messagePattern":"TransactionalId `(.+?)` was not included in the request","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"clients/src/main/java/org/apache/kafka/clients/admin/DescribeTransactionsResult.java","lineNumber":50,"sourceCode":"\n    DescribeTransactionsResult(Map<CoordinatorKey, KafkaFuture<TransactionDescription>> futures) {\n        this.futures = futures;\n    }\n\n    /**\n     * Get the description of a specific transactional ID.\n     *\n     * @param transactionalId the transactional ID to describe\n     * @return a future which completes when the transaction description of a particular\n     *         transactional ID is available.\n     * @throws IllegalArgumentException if the `transactionalId` was not included in the\n     *         respective call to {@link Admin#describeTransactions(Collection, DescribeTransactionsOptions)}.\n     */\n    public KafkaFuture<TransactionDescription> description(String transactionalId) {\n        CoordinatorKey key = CoordinatorKey.byTransactionalId(transactionalId);\n        KafkaFuture<TransactionDescription> future = futures.get(key);\n        if (future == null) {\n            throw new IllegalArgumentException(\"TransactionalId \" +\n                \"`\" + transactionalId + \"` was not included in the request\");\n        }\n        return future;\n    }\n    /**\n     * Get a future which returns a map of the transaction descriptions requested in the respective\n     * call to {@link Admin#describeTransactions(Collection, DescribeTransactionsOptions)}.\n     *\n     * If the description fails on any of the transactional IDs in the request, then this future\n     * will also fail.\n     *\n     * @return a future which either completes when all transaction descriptions complete or fails\n     *         if any of the descriptions cannot be obtained\n     */\n    public KafkaFuture<Map<String, TransactionDescription>> all() {\n        return KafkaFuture.allOf(futures.values().toArray(new KafkaFuture<?>[0]))\n            .thenApply(nil -> {\n                Map<String, TransactionDescription> results = new HashMap<>(futures.size());","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/apache/kafka/blob/996fb4585aa1bcc8980b0e1b8d6b168b986cd979/clients/src/main/java/org/apache/kafka/clients/admin/DescribeTransactionsResult.java#L32-L68","documentation":"Thrown by DescribeTransactionsResult.description() when the given transactionalId maps to a CoordinatorKey that has no entry in the futures map — meaning that transactional ID was not included in the original Admin.describeTransactions request. The message wraps the transactionalId in backticks for clarity.","triggerScenarios":"Calling description(transactionalId) where futures.get(CoordinatorKey.byTransactionalId(transactionalId)) returns null. The ID was not among those passed to describeTransactions.","commonSituations":"Caller queries a transactional ID not in the original request set, or the ID differs by whitespace/case/encoding from what was requested.","solutions":["Only call description(id) with transactional IDs that were in the original describeTransactions request.","Keep the original collection of IDs and verify membership before lookup.","Normalize/trim the ID string to avoid subtle mismatches.","Use the all() future to get every requested result without per-ID lookup."],"exampleFix":"// before\nresult.description(txnId);\n\n// after\nif (requestedTxnIds.contains(txnId)) {\n    result.description(txnId);\n}","handlingStrategy":"validation","validationCode":"Set<String> requestedTxnIds = ...;\nif (!requestedTxnIds.contains(transactionalId)) {\n    throw new IllegalArgumentException(transactionalId + \" not in original request\");\n}\nresult.description(transactionalId);","typeGuard":"boolean wasRequested(Set<String> requested, String txnId) {\n    return requested.contains(txnId);\n}","tryCatchPattern":null,"preventionTips":["Retain the original transactional ID set and check membership before description().","Normalize ID strings to avoid whitespace/case mismatches.","Use all() when you need every result without per-ID lookup."],"tags":["validation","admin","transactions"],"backgroundTag":null,"analyzedSha":"996fb4585aa1bcc8980b0e1b8d6b168b986cd979","analyzedAt":"2026-08-11T22:03:28.655Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}