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

Keda ScaledObject not able to connect to artemis queue #6170

Open
modishivang opened this issue Sep 12, 2024 · 2 comments
Open

Keda ScaledObject not able to connect to artemis queue #6170

modishivang opened this issue Sep 12, 2024 · 2 comments

Comments

@modishivang
Copy link

modishivang commented Sep 12, 2024

I am using Keda version 2.15 and Kubernetes 1.28

Getting below error

Warning KEDAScalerFailed 46s (x6 over 3m16s) keda-operator Get "http://queue-a:8161/console/jolokia/read/org.apache.activemq.artemis:broker=%220.0.0.0%22,component=addresses,address=%22provAPISANDBOXTestConfigin%22,subcomponent=queues,routing-type=%22anycast%22,queue=%22provAPISANDBOXTestConfigin%22/MessageCount": dial tcp: lookup queue-a on 172.20.0.10:53: no such host

If I exec into queue pod, do curl above command, it works successfully.

Here is my keda scaledobject yaml

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: provweb-scaledobject
  namespace: ce-0fda256a-ba0d-4769-9a8e-ac05c2c5eead
spec:
  scaleTargetRef:
    name: provweb-a
  minReplicaCount: 2
  maxReplicaCount: 10
  triggers:
  - type: artemis-queue
    metadata:
      managementEndpoint: "queue-a:8161"
      queueName: "provAPISANDBOXTestConfigin"
      brokerName: "0.0.0.0"
      brokerAddress: "provAPISANDBOXTestConfigin"
      queueLength: '10'
      activationQueueLength: '0'
      username: ''
      password: ''

Please suggest if I missed anything here.

@modishivang
Copy link
Author

Here are the logs of keda-operator pod

2024-09-12T13:23:56Z ERROR artemis_queue_scaler Unable to access the artemis management endpoint {"type": "ScaledObject", "namespace": "ce-0fda256a-ba0d-4769-9a8e-ac05c2c5eead", "name": "provweb-scaledobject", "managementEndpoint": "queue-a:8161", "error": "Get "http://queue-a:8161/console/jolokia/read/org.apache.activemq.artemis:broker=%220.0.0.0%22,component=addresses,address=%22provAPISANDBOXTestConfigin%22,subcomponent=queues,routing-type=%22anycast%22,queue=%22provAPISANDBOXTestConfigin%22/MessageCount\": dial tcp: lookup queue-a on 172.20.0.10:53: no such host"}
github.com/kedacore/keda/v2/pkg/scalers.(*artemisScaler).GetMetricsAndActivity
/workspace/pkg/scalers/artemis_scaler.go:213
github.com/kedacore/keda/v2/pkg/scaling/cache.(*ScalersCache).GetMetricsAndActivityForScaler
/workspace/pkg/scaling/cache/scalers_cache.go:130
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).GetScaledObjectMetrics.func1
/workspace/pkg/scaling/scale_handler.go:524
2024-09-12T13:23:56Z ERROR artemis_queue_scaler Unable to access the artemis management endpoint {"type": "ScaledObject", "namespace": "ce-0fda256a-ba0d-4769-9a8e-ac05c2c5eead", "name": "provweb-scaledobject", "managementEndpoint": "queue-a:8161", "error": "Get "http://queue-a:8161/console/jolokia/read/org.apache.activemq.artemis:broker=%220.0.0.0%22,component=addresses,address=%22provAPISANDBOXTestConfigin%22,subcomponent=queues,routing-type=%22anycast%22,queue=%22provAPISANDBOXTestConfigin%22/MessageCount\": dial tcp: lookup queue-a on 172.20.0.10:53: no such host"}
github.com/kedacore/keda/v2/pkg/scalers.(*artemisScaler).GetMetricsAndActivity
/workspace/pkg/scalers/artemis_scaler.go:213
github.com/kedacore/keda/v2/pkg/scaling/cache.(*ScalersCache).GetMetricsAndActivityForScaler
/workspace/pkg/scaling/cache/scalers_cache.go:140
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).GetScaledObjectMetrics.func1
/workspace/pkg/scaling/scale_handler.go:524
2024-09-12T13:23:56Z ERROR scale_handler error getting metric for trigger {"scaledObject.Namespace": "ce-0fda256a-ba0d-4769-9a8e-ac05c2c5eead", "scaledObject.Name": "provweb-scaledobject", "trigger": "artemisScaler", "error": "Get "http://queue-a:8161/console/jolokia/read/org.apache.activemq.artemis:broker=%220.0.0.0%22,component=addresses,address=%22provAPISANDBOXTestConfigin%22,subcomponent=queues,routing-type=%22anycast%22,queue=%22provAPISANDBOXTestConfigin%22/MessageCount\": dial tcp: lookup queue-a on 172.20.0.10:53: no such host"}
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).GetScaledObjectMetrics
/workspace/pkg/scaling/scale_handler.go:553
github.com/kedacore/keda/v2/pkg/metricsservice.(*GrpcServer).GetMetrics
/workspace/pkg/metricsservice/server.go:48
github.com/kedacore/keda/v2/pkg/metricsservice/api._MetricsService_GetMetrics_Handler.func1
/workspace/pkg/metricsservice/api/metrics_grpc.pb.go:106
github.com/kedacore/keda/v2/pkg/metricsservice.(*GrpcServer).Start.(*ServerMetrics).UnaryServerInterceptor.UnaryServerInterceptor.func6
/workspace/vendor/github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/server.go:22
github.com/kedacore/keda/v2/pkg/metricsservice/api._MetricsService_GetMetrics_Handler
/workspace/pkg/metricsservice/api/metrics_grpc.pb.go:108
google.golang.org/grpc.(*Server).processUnaryRPC
/workspace/vendor/google.golang.org/grpc/server.go:1369
google.golang.org/grpc.(*Server).handleStream
/workspace/vendor/google.golang.org/grpc/server.go:1780
google.golang.org/grpc.(*Server).serveStreams.func2.1
/workspace/vendor/google.golang.org/grpc/server.go:1019

@tomkerkhove tomkerkhove transferred this issue from kedacore/charts Sep 17, 2024
@amitherlekar
Copy link

  1. managementEndpoint: "queue-a:8161" is incorrect. It should be the activemq-artemis service endpoint on your K8s cluster, something like: activemq-svc.default.svc.cluster.local:8161.
  2. The brokerName is incorrect. It should be the name of broker configured in activemq artemis.
  3. Generally, in activemq artemis, the broker address and the queueName is the same. You need to fix that also.

Refer to the KEDA documentation here: https://keda.sh/docs/2.15/scalers/artemis/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Triage
Development

No branches or pull requests

2 participants