Data Source - Unknown error during query transaction. Please check JS console logs

Hello,

I have just added a data source in order to put a prometheus server in it and set up authentication with the “basic auth” mode.

After the addition, I find myself with the following error:

Unknown error during query transaction. Please check JS console logs.

In the console I have this :

XHR OPTIONS https://x/api/v1/query
CORS Missing Allow Origin

Blocage d’une requête multiorigine (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur https://x/api/v1/query. Raison : l’en-tête CORS « Access-Control-Allow-Origin » est manquant.

Blocage d’une requête multiorigine (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur https://x/api/v1/query. Raison : échec de la requête CORS.

I can’t understand this error because I didn’t put any CORS protection on.

Environment:

  • Grafana version: Grafana v8.1.5 (c725a4259a)
  • Data source type & version : Prometheus with browser access
  • OS Grafana is installed on: Kubernetes
  • User OS & Browser: Firefox 93
  • OS Grafana is installed on: Kubernetes

Is this a fresh Grafana install with fresh db on a fresh cluster? or is this an existing Grafana install that was working before?

How are you deploying to K8s?

Fresh cluster

I deployed kubernetes via rke

solved by using “allow-from-origin” into nginx ingress annotations

1 Like