-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Kafka scaler doesn't handle Sarama errors properly #3056
Comments
Hey @lsolovey |
As far as I understand - these Sarama So KEDA Kafka Scaler just needs to fail if Unfortunately I have no experience with Go - I don't think I can write quality Go code as of now. PS. Great job explaining how to use VSCode in BUILD.md ! I was able to debug Kafka scaler without any Go knowledge at all :) |
Great investigation! This is indeed a great feature that would help with investigation once there are problems with Kafka Scaler.
So maybe this is the time where you start with Go, WDYT? It is not that hard :) |
Would be nice to print these extended error messages as a first step. Currently the standard Go error returned from Go client is very generic and it is not obvious where is the problem. This might help especially with debugging auth problems. |
I am willing to contribute this :) |
@liortct any update on this? |
I'm going to do it before the release |
Report
Sarama can report Kafka errors not just as Go standard
error
but rather use custom field on the returned data object.(I'm not a Go expert so please excuse my terminology).
For example,
DescribeTopics()
in Sarama Admin client is declared as:DescribeTopics(topics []string) (metadata []*TopicMetadata, err error)
And
TopicMetadata
is a struct with "custom"KError
field.Kafka scaler only checks for
error
returned fromDescribeTopics
, but it doesn't check for anyKErrors
on the returned payloads.So effectively - some Kafka errors are ignored by KEDA.
The same applies for all other Sarama API calls used by Kafka Scaler.
I debugged KEDA Kafka Scaler - please see the screenshot with a sample response from
DescribeTopics()
call:Expected Behavior
KEDA Kafka Scaler correctly reports errors from Sarama client in logs.
Actual Behavior
KEDA Kafka Scaler doesn't report errors from Sarama client in logs.
No way to troubleshoot Kafka Scaler other than debugging.
Steps to Reproduce the Problem
ScaledObject
with Kafka Trigger. Use TLS certs issued for Kafka principal which has just one RBAC permission:DeveloperRead
permission on the Consumer Group used by Kafka trigger.Logs from KEDA operator
No response
KEDA Version
2.7.1
Kubernetes Version
1.21
Platform
Other
Scaler Details
Kafka
Anything else?
No response
The text was updated successfully, but these errors were encountered: