-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
client/metadata got error from broker while fetching metadata write: broken pipe #2215
Comments
@dnwe |
@ahamedmulaffer broken pipe means the kafka broker / server connection has been forcibly closed at the remote end. Check your Kafka server logs to see if they give a hint as to what is wrong with your configuration or network environment |
@dnwe i am running a 2 node cluster behind HAProxy in my kafka broker log i couldnt see any errors logged or is this related to sarama versions?? |
I’d suspect that your haproxy is chopping the connections maybe. Probably worth looking at the stats interface of haproxy to see which of the three (client, proxy, server) are responsible for closing the connections |
this is my producer config here am i missing anything because same issue has been opened also earlier here i am running a missing critical system every data on the kafka is very important for me Thanks |
@ahamedmulaffer as Dominic above mentioned please try to check HAProxy setup. Have you ever had this setup worked? Just a friendly reminder: please do not tag everyone if you'd like to have some meaningful help. |
thanks @niamster for your reply so far i checked the HA proxy log i coudnt see any its chopping any connections this is the sarama version im using Thanks |
It's hard to tell whether your problem is related to #2173 |
@niamster in the log i am able to see these errors only thanks |
Thank you for providing more information.
I'm not quite sure what kind of help you are asking here. |
@niamster from this what i understand sarama library trying to use the connection which is already closed by kafka which has elapsed the idle time actually how the connection happens here i am attaching my HAProxy config file as well Thanks |
Thanks @ahamedmulaffer for this information. Just to be clear, I've never tried to setup Kafka behind HAProxy so I'm not a great help to you here except trying to help you debugging your setup. If I understand correctly, you actually don't loose any data (I don't see any producer errors in your logs). How do you confirm that you loose some data? I'm speculating here, but what might be happening in your case is that your producer is writing to only one of the configured brokers. Indeed Kafka closes connection after 10 minutes by default if the client does not communicate with it anymore. BTW, did you have a chance to look at HAProxy stats interface as Dominic requested here? |
Hi @ahamedmulaffer , i'm also encountering this same, how can we resolve this. But i'm seeing 2 types of errors here 1 . Could you please help us what all you've tried in the configs? |
Kafka clients relies on a long lived TCP connection to brokers on the contrary to something like HTTP/1.0. This is where the retry logic comes in and if you have a Producer configured as idempotent it will avoid possible duplicates so seeing those errors might not be an issue if they are properly retried. Related to HAProxy used in front of Kafka, I don't think it brings much value. |
Hi @slaunay, we've implemented retry logic(retrying once to form connection again) in case of we get pipe error, EOF error and broker not connected error, but the connection should be reestablished but it's not initiating the connection in 1 retry. Could you please kindly help here? Like how much retries it need to reestablish the connection. Or if there's any other retry mech that we can use to avoid this error. |
i am having these following error in my sarama logs all along
i am using using kafka 2.7.0 and go 1.17 i used sarama version 1.32.0 and after downgraded to 1.30.1 still i see the following errors
is there any workaround for this??
any one could help me on this much appreciated
[sarama] 2022/04/13 23:49:36 client/metadata got error from broker 2 while fetching metadata: write tcp 172.31.16.134:52774->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/13 23:49:36 client/metadata got error from broker 1 while fetching metadata: write tcp 172.31.16.134:46624->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/13 23:51:23 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:49956->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/13 23:59:31 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:55524->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/13 23:59:31 client/metadata got error from broker 2 while fetching metadata: write tcp 172.31.16.134:55522->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/13 23:59:31 client/metadata got error from broker 1 while fetching metadata: write tcp 172.31.16.134:49416->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/13 23:59:36 client/metadata got error from broker 2 while fetching metadata: write tcp 172.31.16.134:55552->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/13 23:59:36 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:55554->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/13 23:59:36 client/metadata got error from broker 1 while fetching metadata: write tcp 172.31.16.134:49450->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/13 23:59:36 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:55562->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/13 23:59:36 client/metadata got error from broker 2 while fetching metadata: write tcp 172.31.16.134:55556->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/13 23:59:36 client/metadata got error from broker 1 while fetching metadata: write tcp 172.31.16.134:49452->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/14 00:01:23 client/metadata got error from broker 2 while fetching metadata: write tcp 172.31.16.134:56058->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/14 04:38:12 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:48010->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/14 04:38:12 client/metadata got error from broker -1 while fetching metadata: kafka: broker not connected
[sarama] 2022/04/14 04:41:27 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:52308->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/14 04:44:52 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:51338->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/14 04:44:52 client/metadata got error from broker 2 while fetching metadata: EOF
[sarama] 2022/04/14 04:44:52 client/metadata got error from broker 1 while fetching metadata: EOF
[sarama] 2022/04/14 04:44:52 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:51334->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/14 04:44:52 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:51342->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/14 04:44:52 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:48014->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/14 04:44:52 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:51344->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/14 04:46:17 client/metadata got error from broker -1 while fetching metadata: EOF
[sarama] 2022/04/14 04:46:17 client/metadata got error from broker -1 while fetching metadata: EOF
[sarama] 2022/04/14 04:46:17 client/metadata got error from broker -1 while fetching metadata: EOF
[sarama] 2022/04/14 04:47:18 client/metadata got error from broker -1 while fetching metadata: EOF
[sarama] 2022/04/14 04:47:18 client/metadata got error from broker -1 while fetching metadata: kafka: broker not connected
[sarama] 2022/04/14 04:49:02 client/metadata got error from broker 1 while fetching metadata: EOF
[sarama] 2022/04/14 04:54:52 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:50830->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/14 04:54:52 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:50832->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/14 04:54:52 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:50838->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/14 04:54:52 client/metadata got error from broker 2 while fetching metadata: write tcp 172.31.16.134:51346->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/14 04:54:52 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:50834->2.48.2.252:9092: write: broken pipe
[sarama] 2022/04/14 04:54:52 client/metadata got error from broker 2 while fetching metadata: write tcp 172.31.16.134:51348->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/14 04:54:52 client/metadata got error from broker -1 while fetching metadata: write tcp 172.31.16.134:54160->2.48.2.252:9093: write: broken pipe
[sarama] 2022/04/14 04:57:08 client/metadata got error from broker 2 while fetching metadata: write tcp 172.31.16.134:56868->2.48.2.252:9093: write: broken pipe
Thanks
Mike
The text was updated successfully, but these errors were encountered: