Skip to content
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

Can't connect to rabbitmq #5127

Closed
qnapnickchang opened this issue Oct 26, 2023 · 5 comments
Closed

Can't connect to rabbitmq #5127

qnapnickchang opened this issue Oct 26, 2023 · 5 comments
Labels
bug Something isn't working stale All issues that are marked as stale due to inactivity

Comments

@qnapnickchang
Copy link

qnapnickchang commented Oct 26, 2023

Report

Config:

`apiVersion: v1
kind: Secret
metadata:
  name: rabbitmq-secret
  namespace: default
data:
  host: YW1xcDovL3FjbG91ZDoxcWF6MndzeEByYWJiaXRtcS1oZWFkbGVzcy5yYWJiaXRtcT

---
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
  name: rabbitmq-auth-conn
  namespace: default
spec:
  secretTargetRef:
    - parameter: host
      name: rabbitmq-secret
      key: host

---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  annotations:
    scaledobject.keda.sh/transfer-hpa-ownership: "true"
  name: test-pod
  namespace: default
spec:
  scaleTargetRef:
    kind: Deployment
    name: test-pod
  pollingInterval: 5
  cooldownPeriod: 30
  minReplicaCount: 0
  maxReplicaCount: 2
  advanced:
    restoreToOriginalReplicaCount: true
    horizontalPodAutoscalerConfig:
      name: test-pod
  triggers:
  - type: rabbitmq
    metadata:
      protocol: amqp
      queueName: test
      mode: QueueLength
      value: "100"
    authenticationRef:
      name: rabbitmq-auth-conn`

Expected Behavior

Connect to Rabbitmq and Authentication

Actual Behavior

no host setting given

Steps to Reproduce the Problem

  1. set secret
  2. set triggerauthentication
  3. set scaledobject

Logs from KEDA operator

{"level":"error","ts":"2023-10-26T02:23:52Z","logger":"scale_handler","msg":"error resolving auth params","type":"ScaledObject","namespace":"default","name":"test","scalerIndex":0,"error":"error parsing rabbitmq metadata: no host setting given","stacktrace":"github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).buildScalers\n\t/workspace/pkg/scaling/scalers_builder.go:83\ngithub.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).performGetScalersCache\n\t/workspace/pkg/scaling/scale_handler.go:366\ngithub.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).GetScalersCache\n\t/workspace/pkg/scaling/scale_handler.go:280\ngithub.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).getScaledObjectState\n\t/workspace/pkg/scaling/scale_handler.go:570\ngithub.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).checkScalers\n\t/workspace/pkg/scaling/scale_handler.go:241\ngithub.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).startScaleLoop\n\t/workspace/pkg/scaling/scale_handler.go:180"}

KEDA Version

2.12.0

Kubernetes Version

1.25

Platform

Amazon Web Services

Scaler Details

rabbitmq

Anything else?

No response

@qnapnickchang qnapnickchang added the bug Something isn't working label Oct 26, 2023
@SpiritZhou
Copy link
Contributor

It looks like the ScaledObject can't find the TriggerAuthentication. However, I tried your settings and it worked fine. Have you tried applying the YAML directly?

@qnapnickchang
Copy link
Author

qnapnickchang commented Oct 26, 2023

Yes, I apply the YAML directly. But I always see this error log

"{"level":"error","ts":"2023-10-26T02:23:52Z","logger":"scale_handler","msg":"error resolving auth params","type":"ScaledObject","namespace":"default","name":"test","scalerIndex":0,"error":"error parsing rabbitmq metadata: no host setting given","stacktrace":"github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).buildScalers\n\t/workspace/pkg/scaling/scalers_builder.go:83\ngithub.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).performGetScalersCache\n\t/workspace/pkg/scaling/scale_handler.go:366\ngithub.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).GetScalersCache\n\t/workspace/pkg/scaling/scale_handler.go:280\ngithub.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).getScaledObjectState\n\t/workspace/pkg/scaling/scale_handler.go:570\ngithub.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).checkScalers\n\t/workspace/pkg/scaling/scale_handler.go:241\ngithub.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).startScaleLoop\n\t/workspace/pkg/scaling/scale_handler.go:180"}"

@arapulido
Copy link
Contributor

@qnapnickchang Can you edit the description of this bug to have those YAML files in a code block, please? That way we can check if there is any issue with formatting. Thanks!

Copy link

stale bot commented Feb 10, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Feb 10, 2024
Copy link

stale bot commented Feb 17, 2024

This issue has been automatically closed due to inactivity.

@stale stale bot closed this as completed Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale All issues that are marked as stale due to inactivity
Projects
Archived in project
Development

No branches or pull requests

3 participants