# org.apache.kafka.common.errors.InvalidPartitionCountException: The partition count 0 is invalid for static group member

- **ID:** `kafka/invalid-partition-count-on-static-membership`
- **Domain:** kafka
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 82%

## Root Cause

Static consumer group membership requires at least one partition assignment; a count of zero indicates a misconfigured or uninitialized assignment strategy.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Kafka 3.5.0 | active | — | — |
| Kafka 3.6.0 | active | — | — |
| Kafka 3.7.0 | active | — | — |

## Workarounds

1. **Ensure the consumer subscribes to at least one topic with partitions before joining the group. Example: consumer.subscribe(Pattern.compile("my-topic-.*"));** (95% success)
   ```
   Ensure the consumer subscribes to at least one topic with partitions before joining the group. Example: consumer.subscribe(Pattern.compile("my-topic-.*"));
   ```
2. **Set partition.assignment.strategy to a non-empty strategy like 'org.apache.kafka.clients.consumer.RangeAssignor' explicitly in consumer config.** (88% success)
   ```
   Set partition.assignment.strategy to a non-empty strategy like 'org.apache.kafka.clients.consumer.RangeAssignor' explicitly in consumer config.
   ```

## Dead Ends

- **Tuning consumer max.poll.records to a higher value** — Increasing max.poll.records does not affect partition assignment count and only delays rebalance timeouts. (90% fail)
- **Deleting group.instance.id from consumer config** — Removing group.instance.id disables static membership but loses group rebalance stability benefits. (70% fail)
