Kafka Error INVALID_TRANSACTION_TIMEOUT
Error code 50 · Non-retriable Transactions
The transaction timeout is larger than the maximum value allowed by the broker (as configured by transaction.max.timeout.ms).
Common Causes
- Producer's transaction.timeout.ms exceeds the broker's transaction.max.timeout.ms (default 900000ms / 15 minutes)
- Broker config was tightened (transaction.max.timeout.ms reduced) after producers were deployed with higher timeout values
- Misconfigured producer template setting transaction.timeout.ms to a very large value (e.g., Integer.MAX_VALUE) for 'safety'
Solutions
- Set producer transaction.timeout.ms to a value strictly less than broker's transaction.max.timeout.ms; default producer value is 60000ms
- Check and align the broker's transaction.max.timeout.ms: kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --describe | grep transaction.max.timeout.ms
- If long-running transactions are needed, increase transaction.max.timeout.ms on the broker with awareness that zombie producers take longer to fence
Diagnostic Commands
# Check broker transaction configuration
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --describe | grep transaction
# Look for transaction events in logs
grep 'INVALID_TRANSACTION_TIMEOUT\|transaction timeout\|transaction.max.timeout' /var/log/kafka/server.log | tail -10Related APIs
This error can be returned by: AddOffsetsToTxn · AddPartitionsToTxn · EndTxn · InitProducerId
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.