-
Notifications
You must be signed in to change notification settings - Fork 801
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
Random errors of "[3] Unknown Topic Or Partition: the request is for a topic or partition that does not exist on this broker" probably related to MSK IAM auth #992
Comments
I think this might be happening on sasl re-authentication. Is there way to know to not write to a topic when the client is re-authenticating? |
As a quick note I get the same error if my kafka user is not authorised for a given topic. |
@jdupl123 how are you authorizing your user for a given topic?
|
No, I also encountered this problem, but no new issues were released. In fact, when I used this library in May this year, I did not observe this error for normal production and consumption, The architecture of the latter project has changed and put kafka as idle, without any production and consumption of messages, and it will appear
I also contacted aws tech support, which did not give me any help and suggested I ask around in the community. I now plan to have aws sdk v2 to rewrite the authentication process, hopefully that will help(By the way, English is not my native language, may not express some accurate) |
Upgrading to aws sdk v2 did not help |
I also noticed the same errors with AWS MSK using SASL authentication.
@ekeric13 Did you find a way to solve this? |
@zhongchen I just used this library instead: It had a different sasl authentication issue but the maintainer is very good and fixed it. |
Hello @ekeric13, I'm glad you got it sorted out using franz-go! Would you be able to share a link to the discussion you had with the franz-go maintainer(s) that helped address your issue? This would be very valuable for us to improve kafka-go as well. |
@achille-roussel I managed to solve the issue by adding an additional external retry logic for the I looked at the code and found that the delay interval of internal retry has an upper bound of |
hello, sorry to bother you, may you tell me increase the value of the writer's conf |
well, simply retry may solve 85% problems, however, in some particular time, 12:30am in my case, this auth error occurs continuously in about 4 minutes |
Describe the bug
So when I use kafka go as a writer, I will randomly get the error
"[3] Unknown Topic Or Partition: the request is for a topic or partition that does not exist on this broker"
.I reproduced this in a sandbox app where I simply just add the current date to a topic every 5 seconds. I am only getting this with SASL auth with the msk iam mechanism.
I have a parallel kafka-go client with TLS auth and I have yet to reproduce this error.
I also wrote a client using franz-go using TLS and SASL authentication with the msk iam authentication and I have yet to reproduce the error there.
So it really does feel specific to kafka-go SASL MSK_IAM auth with the writer.
I think there might be a bug with the msk IAM auth package? Or maybe I need to give it different permissions?
In my sandbox app I give the AWS credentials very thorough permissions:
Kafka Version
Using Kafka 2.6.2 via MSK.
github.com/segmentio/kafka-go v0.4.34
github.com/segmentio/kafka-go/sasl/aws_msk_iam v0.0.0-20220902170624-ba6f4426b511
To Reproduce
I cannot reproduce this immediately. As mentioned above, in order to reproduce I created a sandbox app that authenticated with a working aws account. Furthermore and it doesn't happen right away and usually takes some time to appear, usually lik 4 days. The error will usually occur in batches. Like it will occur for 15 seconds and then just stop.
setup:
usage:
I have copied a couple different setups:
#898 (comment)
but so far I always get the
"[3] Unknown Topic Or Partition: the request is for a topic or partition that does not exist on this broker"
error eventually.Expected Behavior
No errors when writing to a topic using a sasl authenticated connection via msk_iam.
Observed Behavior
Random failures of
"[3] Unknown Topic Or Partition: the request is for a topic or partition that does not exist on this broker"
when writing to a topic using a sasl authenticated connection via msk_iam.The text was updated successfully, but these errors were encountered: