We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The postgreSQL_scaler fails to start up with an error similar to the following:
postgreSQL_scaler
error establishing postgreSQL connection: dial tcp: address tcp/username: unknown port
#2114 broke the Postgresql scaler. The userName argument overwrites the port argument.
userName
port
Compare the GetFromAuthOrMeta calls for port and userName. They both set meta.port so it ends up being set to userName not `port.
GetFromAuthOrMeta
meta.port
keda/pkg/scalers/postgresql_scaler.go
Line 90 in 5b71044
Line 95 in 5b71044
The Postgresql port number is not overwritten by the username value.
The username attribute is used in place of the port number. The username value isn't set at all.
2022-01-02T20:08:10.467Z ERROR scalehandler error resolving auth params {"scalerIndex": 0, "object": {"apiVersion": "keda.sh/v1alpha1", "kind": "ScaledObject", "namespace": "default", "name": "pg-scaler"}, "trigger": 0, "error": "error establishing postgreSQL connection: dial tcp: address tcp/username: unknown port"} github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).getScaledObjectMetricSpecs /workspace/controllers/keda/hpa.go:163 github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).newHPAForScaledObject /workspace/controllers/keda/hpa.go:63 github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).updateHPAIfNeeded /workspace/controllers/keda/hpa.go:124 github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).ensureHPAForScaledObjectExists /workspace/controllers/keda/scaledobject_controller.go:376 github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).reconcileScaledObject /workspace/controllers/keda/scaledobject_controller.go:228 github.com/kedacore/keda/v2/controllers/keda.(*ScaledObjectReconciler).Reconcile /workspace/controllers/keda/scaledobject_controller.go:179 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:114 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:311 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:266 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2 /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:227
2.5.0
1.21
Other
PostgreSQL
2.4.0 works as expected.
The text was updated successfully, but these errors were encountered:
@tsndqst good catch, thx. Are you wiling to open a PR with the fix?
Sorry, something went wrong.
@zroubalik I created a PR but I don't know Go data structures well enough to come up with a test.
@tsndqst I think that it is fine, no need to add a test for this.
Successfully merging a pull request may close this issue.
Report
The
postgreSQL_scaler
fails to start up with an error similar to the following:#2114 broke the Postgresql scaler. The
userName
argument overwrites theport
argument.Compare the
GetFromAuthOrMeta
calls forport
anduserName
. They both setmeta.port
so it ends up being set touserName
not `port.keda/pkg/scalers/postgresql_scaler.go
Line 90 in 5b71044
keda/pkg/scalers/postgresql_scaler.go
Line 95 in 5b71044
Expected Behavior
The Postgresql port number is not overwritten by the username value.
Actual Behavior
The username attribute is used in place of the port number. The username value isn't set at all.
Steps to Reproduce the Problem
Logs from KEDA operator
KEDA Version
2.5.0
Kubernetes Version
1.21
Platform
Other
Scaler Details
PostgreSQL
Anything else?
2.4.0 works as expected.
The text was updated successfully, but these errors were encountered: