kafka-logger reported an error when sending a message, the error message is "closed". #12701
Replies: 3 comments 3 replies
-
|
The "closed" error from kafka-logger means the connection to the Kafka broker was closed before the message could be sent. This can happen due to authentication failures, network interruptions, or misconfiguration of SASL parameters. Even if network connectivity is fine, SASL authentication issues or timeouts can still cause this error. A few things to check:
If you recently upgraded APISIX, make sure your configuration uses the new To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Still reporting the above error |
Beta Was this translation helpful? Give feedback.
-
|
Connecting to Kafka does not report any errors, and topics can be created successfully, but calling the send method results in an error. The error message is as follows: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
1、This is my route:
{"id":"safe-check-route","name":"safe-check-route","desc":"服务群组转发路由","enable_websocket":true,"uri":"/kunlun/ingress/api/cluster2/87c2743baa81475c9a0b54ecb0b902cd/ai-2eeed9b61bb94bf2b0f32b038ebf80de/*","plugins":{"safe-check-forward":{"name":"safe-check-forward","safe_check":true,"safe_check_upstream":"safe_check_upstream","serving_upstream":"servering_upstream"},"kafka-logger":{"_meta":{"filter":[["http_req_safe_checked","==","false"]]},"brokers":[{"host":"172.31.191.10","port":9092,"sasl_config":{"user":"kaclient","password":"0x1jZTDWGtO10+gsxtNP7s1T1lZNaNmy72QYE9HVBEM="},"ssl":false,"ssl_verify":false}],"kafka_topic":"test-topic","log_format":{"completion_tokens":"$completion_tokens","issuer":"$issuer","prompt_tokens":"$prompt_tokens","request_url":"$request_url","appcode_id":"$appcode_id","src":"$src","service_name":"$service_name","http_code":"$status","tpot":"$tpot","ttft":"$ttft","resp_type":"$resp_type","request_time":"$request_time","request_length":"$request_length","upstream_response_length":"$upstream_response_length","start_time":"$start_time","end_time":"$end_time"}}}}
2、I have enabled SASL authentication for Kafka, and my Kafka configuration is correct with no network connectivity issues to Kafka. However, when configuring the route with kafka-logger to send messages, I'm getting an error:
2025/10/27 09:08:37 [error] 59#59: *13938297 [lua] kafka-logger.lua:209: func(): =====partition_id: 0, context: ngx.timer, client: 10.244.99.64, server: 0.0.0.0:9080
2025/10/27 09:08:37 [error] 59#59: *13938300 [lua] producer.lua:268: buffered messages send to kafka err: closed, retryable: true, topic: test-topic, partition_id: 0, length: 1, context: ngx.timer, client: 10.244.99.64, server: 0.0.0.0:9080
How can I troubleshoot this issue?
Beta Was this translation helpful? Give feedback.
All reactions