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

Prometheus AMP scaler returning error : "Credential should be scoped to a valid region." #5419

Closed
sguruvar opened this issue Jan 20, 2024 · 0 comments · Fixed by #5421
Closed
Labels
bug Something isn't working

Comments

@sguruvar
Copy link
Contributor

Report

Amazon Managed Prometheus (AMP) Scaler returning "Credential should be scoped to a valid region."
2024-01-19T22:35:52Z ERROR prometheus_scaler error executing prometheus query {"type": "ScaledObject", "namespace": "default", "name": "so", "error": "prometheus query api returned error. status: 403 response: {\"message\":\"Credential should be scoped to a valid region. \"}"} github.com/kedacore/keda/v2/pkg/scalers.(*prometheusScaler).GetMetricsAndActivity /workspace/pkg/scalers/prometheus_scaler.go:391

Expected Behavior

Root cause is that the AWS region is taken as empty

Actual Behavior

2024-01-19T22:35:52Z ERROR prometheus_scaler error executing prometheus query {"type": "ScaledObject", "namespace": "default", "name": "so", "error": "prometheus query api returned error. status: 403 response: {\"message\":\"Credential should be scoped to a valid region. \"}"} github.com/kedacore/keda/v2/pkg/scalers.(*prometheusScaler).GetMetricsAndActivity /workspace/pkg/scalers/prometheus_scaler.go:391

Steps to Reproduce the Problem

  1. Take latest Keda core with helm v2.13.1
  2. Try with the below podIdentity and scaledObject
  3. You will see the error
    apiVersion: keda.sh/v1alpha1 kind: TriggerAuthentication metadata: name: keda-trigger-auth-aws-credentials spec: podIdentity: provider: aws

apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: name: so spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: songinx cooldownPeriod: 1 fallback: failureThreshold: 3 replicas: 1 minReplicaCount: 1 maxReplicaCount: 30 advanced: horizontalPodAutoscalerConfig: behavior: scaleDown: stabilizationWindowSeconds: 15 triggers: - type: prometheus authenticationRef: name: keda-trigger-auth-aws-credentials metadata: serverAddress: https://aps-workspaces.us-east-2.amazonaws.com/workspaces/ws-d3284d62-5c77-4c0d-8095-7f752dd585dc metricName: s0-prometheus awsRegion: us-east-2 threshold: "10.0" query: vector(100) identityOwner: operator

Logs from KEDA operator

2024-01-19T22:35:52Z	ERROR	prometheus_scaler	error executing prometheus query	{"type": "ScaledObject", "namespace": "default", "name": "so", "error": "prometheus query api returned error. status: 403 response: {\"message\":\"Credential should be scoped to a valid region. \"}"}
github.com/kedacore/keda/v2/pkg/scalers.(*prometheusScaler).GetMetricsAndActivity
	/workspace/pkg/scalers/prometheus_scaler.go:391

KEDA Version

2.13.0

Kubernetes Version

1.27

Platform

Amazon Web Services

Scaler Details

Prometheus

Anything else?

No response

@sguruvar sguruvar added the bug Something isn't working label Jan 20, 2024
sguruvar added a commit to sguruvar/keda that referenced this issue Jan 20, 2024
Signed-off-by: Siva Guruvareddiar <sivagurunath@gmail.com>
sguruvar added a commit to sguruvar/keda that referenced this issue Jan 20, 2024
Signed-off-by: Siva Guruvareddiar <sivagurunath@gmail.com>
sguruvar added a commit to sguruvar/keda that referenced this issue Jan 20, 2024
Signed-off-by: Siva Guruvareddiar <sivagurunath@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant