[Question] Specified group generation id is not valid

See original GitHub issue

Describe the bug Consumers (sometimes) encounters the following exception: Specified group generation id is not valid. The consumers that encounters that error become a kind of Zombie. They are still connected as consumers to a partition but not consuming messages.

To Reproduce Can’t reproduce

Expected behavior The consumer should reconnect to the consumer grouop.

Observed behavior Logs:

  1. [ConsumerGroup] Consumer has joined the group
  2. The group is rebalancing, so a rejoin is needed
  3. Specified group generation id is not valid

Environment:

  • OS: [alpine]
  • KafkaJS version [1.15.0]
  • Kafka version [2.4.1]
  • NodeJS version [14]

Additional context It’s probably not related to KafkaJs, but there is a mention of that error error.js and maybe you have any idea why it’s happening?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Nevoncommented, Jan 28, 2021

The groupGenerationId is something we get from the broker (generation_id) in the JoinGroup response, and it’s just a number that increments with each generation in the group.

You’ll get this error when you try to commit after having been kicked out of the consumer group. This could for example happen if you spend too long in between heartbeats (because you’re processing a single message for too long, for example). What should happen is that you should re-join the group and get the new generation id to use.

It would be helpful if you could run with DEBUG log level so that we can see what requests are being made when this happens.

The consumers that encounters that error become a kind of Zombie. They are still connected as consumers to a partition but not consuming messages.

This is a shot in the dark, but do you maybe have more consumer instances than you do partitions? If so, some of your consumers will not be assigned any partitions, and thus won’t be doing any work.

0reactions
guiestimoneoncommented, Dec 23, 2022

Hello guys

I am having this issue when I scale my application horizontally. The pod is processing normally and out of nowhere I get this error:

image

I suspect a rebalance has occurred and the pod still tries to commit a message. I’ve tried the above solutions but to no avail.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Broker: Specified group generation id is not valid
Problem. First, one of my consumers encounters the following exception. Confluent.Kafka.KafkaException: Broker: Specified group generation id is ...
Read more >
Re: automatic offset reset question - The Mail Archive
What I think is happening is the consumer group gets reset to the ... at offset 5499236332: Specified group generation id is >...
Read more >
edenhill/librdkafka - Gitter
... Broker: Specified group generation id is not valid error during rebalance (even when using the built-in rebalance callback). Will put in an...
Read more >
How to fix the MEMBER_ID Error in Kafka - Dattell
In this post we discuss how to resolve the Kafka error "join group failed with org.apache.kafka.common.errors.memberidrequiredexception".
Read more >
Kafka protocol guide - Apache Kafka
Error Code Retriable UNKNOWN_SERVER_ERROR ‑1 False NONE 0 False OFFSET_OUT_OF_RANGE 1 False
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found