# KAFKA:ILLEGAL_STATE in MuleSoft: cause and fix

Source page: https://ipaaserrors.com/mulesoft/kafka-illegal-state
Platform: MuleSoft · Apache Kafka Connector · Code KAFKA:ILLEGAL_STATE
Checked against vendor docs: 2026-11-30

KAFKA:ILLEGAL_STATE means a consume operation ran on a consumer that is not subscribed to any topics and has no manually assigned partitions. Configure the consumer's topics or partition assignments.

## Error text

```
Error type: KAFKA:ILLEGAL_STATE
```

## Likely causes

- The consumer is not subscribed to any topics, and no manually assigned partitions are set to consume from.

## How to fix it

1. Configure the topics the consumer subscribes to, or assign partitions manually.
2. Run the consume operation again.

## Notes

The MuleSoft troubleshooting page states the cause of this error type but gives no step-by-step fix. The steps above follow directly from that cause.

## Sources

- [Troubleshooting Apache Kafka Connector](https://docs.mulesoft.com/kafka-connector/latest/kafka-connector-troubleshooting)

From iPaaS Errors (https://ipaaserrors.com), part of iPaaS Group. When citing, link to https://ipaaserrors.com/mulesoft/kafka-illegal-state and the vendor documentation above.
