Kafka Error INVALID_CONFIG
Error code 40 · Non-retriable Admin
Configuration is invalid.
Common Causes
- Topic or broker config value is outside the allowed range or of the wrong type (e.g., retention.ms=-5, min.insync.replicas=0)
- Unrecognized config key passed to kafka-configs.sh --alter (typo, or config removed in the broker version being used)
- Conflicting config values (e.g., min.insync.replicas > replication factor for the topic)
Solutions
- Validate config values against the broker's documented valid range before applying; use kafka-configs.sh --describe to check current values
- Check the exact error message in broker logs — it identifies the offending key and why it is invalid
- Ensure min.insync.replicas <= replication factor for every topic; alert on this invariant in your provisioning tooling
Diagnostic Commands
# Describe topic-level configuration overrides
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name <topic> --describe
# Look for config validation errors in logs
grep 'INVALID_CONFIG\|Invalid config\|configuration is invalid' /var/log/kafka/server.log | tail -20
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.