Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash: KafkaJSNonRetriableError: Specified group generation id is not valid #1712

Open
oleh-poberezhets opened this issue Aug 16, 2024 · 2 comments

Comments

@oleh-poberezhets
Copy link

Hello

We have the problem with consumers crash.
It's look like the same problem described in #1466 and #1474
But we have "kafkajs": "2.2.4", module with fix from #1474.

Logs from crashed pod:
Screenshot 2024-08-15 at 22 11 53

Logs from all pods at the same time
Screenshot 2024-08-16 at 12 34 44

Maybe it has something to do with how we commit the offset:

        const autoCommit = false;
        const partitionsConsumedConcurrently = 1;
        
        await this.consumer.run({
            partitionsConsumedConcurrently,
            autoCommit,
            eachMessage: async ({ topic, partition, message }) => {
                const { error, decodedMessage } = await this.deserialize(
                    message,
                    formatOptions,
                );

                try {
                    await onMessageHandler(
                        error,
                        decodedMessage,
                        message.offset,
                        topic,
                        partition,
                        message.timestamp,
                    );

                    if (!autoCommit) {
                        await this.consumer.commitOffsets([
                            {
                                topic,
                                partition,
                                offset: (parseInt(message.offset, 10) + 1).toString(),
                            },
                        ]);
                    }
                } catch (e) {
                    this.logger.logError(e);

                    throw e;
                }
            },
        });

Environment:

  • KafkaJS version - 2.2.4
  • NodeJS version - 20.11.0
@HassanRazaMuhammadTufail

I am also facing same issue, logs shows that consumer crashes after I get this error few times with in a shorter span. @oleh-poberezhets have you found any work around?

@oleh-poberezhets
Copy link
Author

I am also facing same issue, logs shows that consumer crashes after I get this error few times with in a shorter span. @oleh-poberezhets have you found any work around?

We will try to test consumers with enabled AutoCommit.
I will let you know when the results are in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants