Kafka Error INVALID_TIMESTAMP
Error code 32 · Non-retriable Producer
The timestamp of the message is out of acceptable range.
Common Causes
- Producer host clock is severely skewed (NTP drift or VM clock issues), causing record timestamps to fall outside the allowed CreateTime window enforced by topic configs message.timestamp.before.max.ms / message.timestamp.after.max.ms or the broker defaults log.message.timestamp.before.max.ms / log.message.timestamp.after.max.ms
- Application is manually setting ProducerRecord timestamps to stale or future values (for example replaying historical events) without adjusting broker or topic policy
- message.timestamp.type=CreateTime combined with tight before/after timestamp bounds rejects records whose timestamps are too far from broker time
Solutions
- Sync producer hosts via NTP (chronyc tracking / timedatectl status) and ensure clock skew stays within the topic or broker timestamp bounds before retrying
- If replaying historical or future-dated events is expected, raise the topic-level message.timestamp.before.max.ms / message.timestamp.after.max.ms, or the broker defaults log.message.timestamp.before.max.ms / log.message.timestamp.after.max.ms
- If producer-supplied timestamps should not control acceptance for this topic, set topic config message.timestamp.type=LogAppendTime, or broker default log.message.timestamp.type=LogAppendTime
Diagnostic Commands
# Check topic timestamp configuration
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name <topic> --describe | grep timestamp
# Search logs for related error messages
timedatectl show --property=NTPSynchronized,TimeUSec && chronyc tracking 2>/dev/null | grep 'RMS offset'Related APIs
This error can be returned by: Produce
Related KIPs
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.