kafka icon indicating copy to clipboard operation
kafka copied to clipboard

How to handle OffsetOutOfRange error?

Open zer0Id0l opened this issue 8 years ago • 4 comments

Consumers are not able to consume from the consumer due to OffsetOutOfRange error. I am adding recoveryOffset to recover subscription in case of OffsetOutOfRange.

let consumer = new kafka.GroupConsumer({
   connectionString: connectionString,
   groupId: groupId,
   recoveryOffset: kafka.LATEST_OFFSET,
});

I see this debug log from consumer, but it never updates the offset

2016-10-25T22:05:14.759Z WARN no-kafka-client Updating offset because of OffsetOutOfRange error for kafkamon-pubsub-topic:3

Am I missing something?

zer0Id0l avatar Oct 25 '16 22:10 zer0Id0l

I have the same problem.

@rrs120486: Did you find a solution for this?

monkybrain avatar Oct 31 '16 10:10 monkybrain

Not exactly, but I tried setting everything to LATEST_OFFSET.

recoveryOffset: kafka.LATEST_OFFSET,
startingOffset: kafka.LATEST_OFFSET,
time: kafka.LATEST_OFFSET

Also tried adding time: kafka.LATEST_OFFSET in strategies. Sometimes it recovers but not everytime.

PS: If I use Java consumer API to consume from same topic state it does that successfully. So most probably something missing in nodeJs implementation.

zer0Id0l avatar Nov 01 '16 16:11 zer0Id0l

Which version of Kafka are you running?

I switched to 0.10.1.0 and don't have that problem any more.

monkybrain avatar Nov 02 '16 08:11 monkybrain

I am using 0.9.0. We cannot upgrade our clusters to 0.10.0 as of now. :(

zer0Id0l avatar Nov 02 '16 23:11 zer0Id0l