Hi! I am trying to connect GDCN with BigQuery and ...
# gooddata-cn
Hi! I am trying to connect GDCN with BigQuery and when I try to add the datasource to GDCN I keep getting this error. Already tried other datasources (like postgresql) and they work fine. I think is something related to the "token" key in my database connection details. How this key needs to be inserted in the json sent to GDCN? Can someone provide an example? Thanks!
You have to encode the content of the service account file with base64
And put the encoded value into dataSource.token attribute
I've done that, maybe the key in the json declared in a wrong way? The documentation is not clear on where to put the encoded service account file.
PS: In this print I am using the /api/actions/dataSource/test endpoint to test connectivity.
ccing people from GoodData Cloud as the issue appears in totvs GoodData Cloud environment as well - @Jiri Mikulasek @Martin Cermak @Libor Rysavy
@BRENO ZIPOLI MONTEIRO PAPA we need to know how exactly you create the values of token. My token file looks like this:
Copy code
  "type": "service_account",
  "project_id": "gdc-us-dev",
  "private_key_id": "xxxxx",
  "private_key": "-----BEGIN PRIVATE KEY-----\nxxxxx\n-----END PRIVATE KEY-----\n",
  "client_email": "<mailto:xxx@gdc-us-dev.iam.gserviceaccount.com|xxx@gdc-us-dev.iam.gserviceaccount.com>",
  "client_id": "108088797846722243861",
  "auth_uri": "<https://accounts.google.com/o/oauth2/auth>",
  "token_uri": "<https://oauth2.googleapis.com/token>",
  "auth_provider_x509_cert_url": "<https://www.googleapis.com/oauth2/v1/certs>",
  "client_x509_cert_url": "<https://www.googleapis.com/robot/v1/metadata/x509/tiger-tests%40gdc-us-dev.iam.gserviceaccount.com>"
I store it into file
and run:
Copy code
base64 -w0 service_account.json
I paste the result into the token field in the request for /api/actions/dataSource/test API and it works. If your call of the API ends with status 500, please, send us the traceId from the request in text form, so we can copy and paste it into our logging/monitoring and investigate the issue.
@Jan Soubusta I am using the command below to encode my token file (taken from https://www.gooddata.com/developers/cloud-native/doc/1.4/administration/data-sources/supported/bigquery/): $File = ".\service_account.json" $Content1 = get-content $File $Bytes = [System.Text.Encoding]::UTF8.GetBytes($Content1) $Encoded = [System.Convert]::ToBase64String($Bytes) Write-Host "ENCODED: " $Encoded Then I insert the output on my api call like this: "token": "eyAgICJ0eXBlIjogIn....." I am getting 500 status error, here is the traceid: {"detail":"Server-side problem. Contact support.","status":500,"title":"Internal Server Error","traceId":"1b05eab2f905d23e"}
@BRENO ZIPOLI MONTEIRO PAPA thanks! Now I know where is the root cause. Let me discuss it internally, I'll get back to you as soon as possible.