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

Produce failed with a fatal error. This producer instance cannot be used anymore. #61

Closed
adamkeesey opened this issue May 14, 2021 · 5 comments
Labels
enhancement New feature or request error-handling

Comments

@adamkeesey
Copy link

Trying to use a transactional producer but keep getting this error:

Jobcloud\Kafka\Exception\KafkaProducerTransactionFatalException
Produce failed with a fatal error. This producer instance cannot be used anymore.

I'm using the example in the README.

php: 8.0
rdkafka support => enabled
librdkafka version (runtime) => 1.4.2
librdkafka version (build) => 1.4.2.255
php-rdkafka: 5.0.0

From what I can tell, I met the requirements. Any advice would be great

@nick-zh
Copy link
Contributor

nick-zh commented May 16, 2021

You're transaction reached a fatal state. I saw that we are not exposing the original message, so right now it is hard to see what is going on, unless you add the below code here

var_dump($e->getMessage());

I'll get a fix out, so the original reason is exposed as well ✌️

@nick-zh
Copy link
Contributor

nick-zh commented May 16, 2021

Sidenote: I advise updating to librdkafka:1.7 as well, a lot of transaction related bugfixes have been included since librdkafka:1.4

@nick-zh
Copy link
Contributor

nick-zh commented May 16, 2021

I just created a new release, the exception message should be more meaningful now, also with $e->getPrevious() you can get the original exception, i hope this helps you narrow the problem down. Let me know if you need additional help ✌️

@nick-zh nick-zh added enhancement New feature or request error-handling labels May 16, 2021
@adamkeesey
Copy link
Author

Thank you, that extra error handling gave me "The Transactional API requires transactional.id to be configured". Just needed to add transactional.id on the producer configuration.

@nick-zh
Copy link
Contributor

nick-zh commented May 17, 2021

Cool, glad to hear it ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request error-handling
Development

No branches or pull requests

2 participants