KedaProvider GetExternalMetric can return nil,nil
and cause nil pointer reference
#6009
Labels
bug
Something isn't working
nil,nil
and cause nil pointer reference
#6009
Report
Here in the the
KedaProvider
https://github.com/openshift/kedacore-keda/blob/be1b1737c53f708a62a6a7386b27f5f208bf7094/pkg/provider/provider.go#L92. TheGetExternalMetric
function can returnnil,nil
in the wait for the connection to be ready:since it does not reassign the
err
variable.This is reflected by a stack trace thrown in the keda metrics api-server pod below.
The
nil,nil
gets dereferenced here: https://github.com/kubernetes-sigs/custom-metrics-apiserver/blob/1e7ed5df24ef39898861260b002d9400f2d09300/pkg/registry/external_metrics/reststorage.go#L87 and hence panics in the code.Expected Behavior
Expect the code to not panic.
Actual Behavior
The keda-api-metrics-server pod crashes.
Steps to Reproduce the Problem
Logs from KEDA operator
KEDA Version
2.12.1
Kubernetes Version
None
Platform
Red Hat OpenShift
Scaler Details
No response
Anything else?
The scaled object is of prometheus type:
The text was updated successfully, but these errors were encountered: