conduktor.io ↗

Kafka Exception StreamsException

org.apache.kafka.streams.errors.StreamsException
Non-retriable Streams

StreamsException is the top-level exception type generated by Kafka Streams, and indicates errors have occurred during a StreamThread StreamThread's processing. It is guaranteed that any exception thrown up to the StreamsUncaughtExceptionHandler will be of the type StreamsException. For example, any user exceptions will be wrapped as a StreamsException.

Common Causes

Solutions

Example Stack Trace

org.apache.kafka.streams.errors.StreamsException: Exception caught in process. taskId=0_2, processor=KSTREAM-SOURCE-0000000000, topic=orders, partition=2, offset=98123, stacktrace=java.lang.NullPointerException at org.apache.kafka.streams.processor.internals.StreamTask.process(StreamTask.java:756) at org.apache.kafka.streams.processor.internals.TaskExecutor.processTask(TaskExecutor.java:95) at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:777) at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:617) at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:579) Caused by: java.lang.NullPointerException at com.example.OrderProcessor.process(OrderProcessor.java:33)

Diagnostic Commands

kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-app # check stuck offset / lag at the failing partition kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic orders --partition 2 --offset 98123 --max-messages 1 # inspect the exact record at the offset in the stack trace

Related

Related Streams exceptions: BrokerNotFoundException · InternalTopicsAlreadySetupException · InvalidStateStoreException · InvalidStateStorePartitionException · LockException · MisconfiguredInternalTopicException · MissingInternalTopicsException · MissingSourceTopicException

Hitting StreamsException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.