influxdata/influxdb-gds-connector

no buckets found in organization

Opened this issue · 5 comments

Hi,

We are using Influx Cloud v2 with Google Data Studio connector and we have the following error for a few days :

"GetBuckets from: https://eu-central-1-1.aws.cloud2.influxdata.com" returned an error:Exception: Request failed for https://eu-central-1-1.aws.cloud2.influxdata.com returned code 404. Truncated server response: {"code":"not found","message":"no buckets found in organization **************"} (use muteHttpExceptions option to examine full response)

Capture d’écran 2021-04-19 à 16 16 29

The identifiers and Uri have not changed.

Do you have any idea of ​​the source of the problem?

Thank you

@dmeireles, thanks for using our connector.

It looks like that your token doesn't have permission to read from selected bucket. Could you please check the following queries:

  1. Query to Buckets:
curl "https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/query?org=YOUR_ORG" \
  -H "Accept: application/csv" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-type: application/vnd.flux" \
  -d 'buckets() |> rename(columns: {"name": "_value"}) |> keep(columns: ["_value"]) |> sort(columns: ["_value"], desc: false)'
  1. Query to Measurements:
curl "https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/query?org=YOUR_ORG" \
  -H "Accept: application/csv" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-type: application/vnd.flux" \
  -d 'import "influxdata/influxdb/v1"

v1.tagValues(
  bucket: "YOUR_SELECTED_BUCKET",
  tag: "_measurement",
  predicate: (r) => true,
  start: duration(v: uint(v: 1970-01-01) - uint(v: now()))
)'  
  1. Query to Tags:
curl "https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/query?org=YOUR_ORG" \
  -H "Accept: application/csv" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-type: application/vnd.flux" \
  -d 'import "influxdata/influxdb/v1"

v1.tagKeys(
  bucket: "YOUR_SELECTED_BUCKET",
  predicate: (r) => r._measurement == "YOUR_SELECTED_MEASUREMENT",
  start: duration(v: uint(v: 1970-01-01) - uint(v: now()))
)
|> filter(fn: (r) => r._value != "_start" and r._value != "_stop" and r._value != "_measurement" and r._value != "_field")'  
  1. Query to Fields:
curl "https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/query?org=YOUR_ORG" \
  -H "Accept: application/csv" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-type: application/vnd.flux" \
  -d 'from(bucket: "YOUR_SELECTED_BUCKET")
    |> range(start: time(v: 1))
    |> filter(fn: (r) => r["_measurement"] == "YOUR_SELECTED_MEASUREMENT") 
    |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
    |> drop(columns: ["_start", "_stop", "_time", "_measurement"])
    |> limit(n:1)'  

Regards

Hello,

Thank you for your reply.

I did the tests you asked me and I have the feeling that the buckets that contain _ in their name have not return for a few days (ex : test_pixxid or test_hsecaraibes in picture).
The other buckets are available in the result (ex : hsem1)

The result of the query for the list of buckets :

curl "https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/query?org=**************" \

-H "Accept: application/csv"
-H "Authorization: Token z*****************************************************3Eog=="
-H "Content-type: application/vnd.flux"
-d 'buckets() |> rename(columns: {"name": "_value"}) |> keep(columns: ["_value"]) |> sort(columns: ["_value"], desc: false)'
,result,table,_value
,_result,0,hsem1

Maybe you exclude names with underscore ?

The majority of my buckets are named ans, do you think you can revert to the previous operation?

Thank you

TEST TOKEN

Hello,

Thank you for your reply.

I did the tests you asked me and I have the feeling that the buckets that contain _ in their name have not return for a few days (ex : test_pixxid or test_hsecaraibes in picture).
The other buckets are available in the result (ex : hsem1)

The result of the query for the list of buckets :

curl "https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/query?org=**************" \

-H "Accept: application/csv"
-H "Authorization: Token z*****************************************************3Eog=="
-H "Content-type: application/vnd.flux"
-d 'buckets() |> rename(columns: {"name": "_value"}) |> keep(columns: ["_value"]) |> sort(columns: ["_value"], desc: false)'
,result,table,_value
,_result,0,hsem1

The same query is also used for retrieving buckets in connector. As you see at your result output there is only bucket hsem1. Try to generate new token.

Maybe you exclude names with underscore ?

No, there isn't this type of exclusion.

I ran test for a following token:

image

and results are correct:

curl "https://us-west-2-1.aws.cloud2.influxdata.com/api/v2/query?org=MY_ORG" \
  -H "Accept: application/csv" \
  -H "Authorization: Token MY_TOKEN" \
  -H "Content-type: application/vnd.flux" \
  -d 'buckets() |> rename(columns: {"name": "_value"}) |> keep(columns: ["_value"]) |> sort(columns: ["_value"], desc: false)'


,result,table,_value
,_result,0,github
,_result,0,test_underscore

I recreated a new token and still have an incomplete bucket list.
This is necessarily a problem to the API https://eu-central-1-1.aws.cloud2.influxdata.com/api/v2/
which does not make the link between the token and the authorized buckets

I made a ticket to influxData support to give me an answer

Thanks a lot for your help

You are welcome