From c8ad2c00168ebb109643df63a8d0c3b21b3af776 Mon Sep 17 00:00:00 2001 From: lena-larionova Date: Wed, 17 Jun 2026 22:43:03 -0700 Subject: [PATCH 1/2] add debugging section on kafka upstream plugin --- app/_kong_plugins/kafka-upstream/index.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/_kong_plugins/kafka-upstream/index.md b/app/_kong_plugins/kafka-upstream/index.md index af21686968..f91fb94add 100644 --- a/app/_kong_plugins/kafka-upstream/index.md +++ b/app/_kong_plugins/kafka-upstream/index.md @@ -66,6 +66,21 @@ When encoding request bodies, several things happen: {% include_cached /plugins/confluent-kafka-consume/schema-registry.md name=page.name slug=page.slug workflow='producer' %} +## Debugging {% new_in 3.15 %} + +By default, produce failures return a generic error to the HTTP client and log the real cause in the {{site.base_gateway}} logs: + +```json +{"message": "Bad Gateway", "error": "could not send message to topic"} +``` + +To include the detailed Kafka client error in the response instead, set [`config.error_handling.return_error_message`](/plugins/kafka-upstream/reference/#schema--config-error-handling-return-error-message) to `true` (`false` by default). +This lets you see the exact broker rejection (for example, `TopicAuthorizationFailed`) without checking the {{site.base_gateway}} logs. + +{:.warning} +> **Warning**: Do not enable this in production. +> The detailed error may expose internal details like topic names and ACL denials. + ## Known issues and limitations Known limitations: From 3b507b193f1c609bb710263a15e34876263cc14a Mon Sep 17 00:00:00 2001 From: lena-larionova <54370747+lena-larionova@users.noreply.github.com> Date: Thu, 18 Jun 2026 11:09:46 -0700 Subject: [PATCH 2/2] minor edit for clarity --- app/_kong_plugins/kafka-upstream/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/_kong_plugins/kafka-upstream/index.md b/app/_kong_plugins/kafka-upstream/index.md index f91fb94add..e134789cb3 100644 --- a/app/_kong_plugins/kafka-upstream/index.md +++ b/app/_kong_plugins/kafka-upstream/index.md @@ -68,7 +68,7 @@ When encoding request bodies, several things happen: ## Debugging {% new_in 3.15 %} -By default, produce failures return a generic error to the HTTP client and log the real cause in the {{site.base_gateway}} logs: +By default, when producing a message fails, the plugin returns a generic error to the HTTP client and logs the real cause in the {{site.base_gateway}} logs: ```json {"message": "Bad Gateway", "error": "could not send message to topic"}