Kafka Exception InvalidGroupIdException
org.apache.kafka.common.errors.InvalidGroupIdException
Non-retriable
Consumer
InvalidGroupIdException is a Kafka exception (org.apache.kafka.common.errors.InvalidGroupIdException).
Common Causes
- Consumer configured with an empty or null group.id
- Consumer 'group.id' property not set at all — required for any consumer that commits offsets
- Application using a consumer without group.id in manual partition assignment mode then accidentally calling commitSync() or commitAsync() which requires a valid group
Solutions
- Always set a non-empty, meaningful 'group.id' for every consumer application; use a descriptive name like '<app-name>-<env>-consumer' for observability
- If using manual partition assignment (assign() instead of subscribe()), do not call commitSync() or commitAsync() to the group coordinator — manage offsets externally or in a dedicated offset topic
- Validate group.id at application startup and fail fast if it is null or empty rather than discovering the error at first poll
Example Stack Trace
org.apache.kafka.common.errors.InvalidGroupIdException: The group id is invalid.Diagnostic Commands
# List all consumer groups
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list
# Look for group ID errors in config
grep -E 'InvalidGroupId|group.id' <application-config-file>Related
Protocol error: INVALID_GROUP_ID (code 24)
Related Consumer exceptions: CommitFailedException · CoordinatorLoadInProgressException · CoordinatorNotAvailableException · FencedInstanceIdException · FencedMemberEpochException · GroupMaxSizeReachedException · IllegalGenerationException · InvalidOffsetException
Hitting
InvalidGroupIdException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.