Can't access a BigQuery table connected to Gsheet

Hello,

I have a BigQuery table connected to a Google Sheet located in my google Drive. I can query the table on BigQuery but I can't access it with Metabase. I get this error message when trying:

Access Denied: BigQuery BigQuery: Permission denied while getting Drive credentials.

I have added my service account email to the Google sheet as editor, but it still doesn't work. It seems like I need to add some additional rights to my service account but I can't figure out how to do it.

Could you please advise? Thanks!

1 Like

Hi @jsaadani
There's an issue open about this - see comments for possible workarounds:
https://github.com/metabase/metabase/issues/13001 - upvote by clicking :+1: on the first post

Thanks @flamber for your reply. I had a look a the workaround you mentioned. I have enabled the Google Drive API in my project but It still doesn't work.

  • It seems like I can't enable the Google Workspace Domain-wide Delegation. I get an error when trying to do so:

The request has been classified as abusive and was not allowed to proceed

Moreover, I don't see how I can add scopes to an existing service account using google cloud console.

Thanks for your help.

Jaafar

@jsaadani The workaround I posted is for the old OAuth, not Service Accounts. But I guess it doesn't work then, and then you'll have to wait until the issue is fixed or try to find another workaround.

I am having the same issue here and I am not able to solving it either, do you know if is going to be solve soon? We really need to use this 🥲

Thanks a lot!

Was anyone able to solve this? I'm encountering the same issue even when domain wide delegation is enabled on the service account.

@AyrtonB Work is currently being done to add this functionality: https://github.com/metabase/metabase/pull/19629

1 Like

Thanks, that's great!

i'm still getting a 403 with a service account + sharing permissions + json file. the git thread looks to have not been updated in a bit. could you please advise?

this link from this page is broken.

@joshtt Make sure you're using version 0.42.0 or newer with the new BigQuery driver:
https://www.metabase.com/docs/latest/administration-guide/databases/bigquery.html#connecting-metabase-to-google-drive-data-sources

1 Like

Hi All
I'm facing the same problem. My Metabase version is 0.44. 3 the latest.
I have a BigQuery table connected to a Google Sheet located in my google Drive as well. I can query the table on BigQuery. then success to add Bigquery database to Metabase, No error message during connecting the bigquery to metabase. However when I try to add question, only the database from bigquery name appears with not any single table to access.

I try to check the metabase log and find word bigquery this is what I found :
[eab1e4d9-e2a1-4b82-b562-c888bc00e8f3] 2022-09-28T08:41:11+07:00 ERROR metabase.driver.bigquery-cloud-sdk Exception caught in :bigquery-cloud-sdk can-connect?
com.google.cloud.bigquery.BigQueryException: java.lang.InterruptedException
at com.google.cloud.bigquery.BigQueryException.translateAndThrow(BigQueryException.java:122)
at com.google.cloud.bigquery.BigQueryImpl.listDatasets(BigQueryImpl.java:475)
at com.google.cloud.bigquery.BigQueryImpl.listDatasets(BigQueryImpl.java:441)
at metabase.driver.bigquery_cloud_sdk$list_tables.invokeStatic(bigquery_cloud_sdk.clj:67)
at metabase.driver.bigquery_cloud_sdk$list_tables.invoke(bigquery_cloud_sdk.clj:56)
at metabase.driver.bigquery_cloud_sdk$list_tables.invokeStatic(bigquery_cloud_sdk.clj:61)
at metabase.driver.bigquery_cloud_sdk$list_tables.invoke(bigquery_cloud_sdk.clj:56)
at metabase.driver.bigquery_cloud_sdk$fn__82510.invokeStatic(bigquery_cloud_sdk.clj:96)
at metabase.driver.bigquery_cloud_sdk$fn__82510.invoke(bigquery_cloud_sdk.clj:93)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at metabase.driver.util$can_connect_with_details_QMARK_$fn__33135.invoke(util.clj:138)

What is the problem and what is the solution?
Thank you for all your attention and help

BR
Taufik

@taufik Sounds like a different problem than this topic if you cannot find any tables. https://www.metabase.com/docs/latest/troubleshooting-guide/cant-see-tables

@flamber
Thank you for your quick response.
Do you have any special trouble shooting guide that spesific for bigquery table. because the reference you gave is not specific for bigquery

Thank you
Best Regards
Taufik

@taufik When Metabase cannot see a table, then it's usually a permission problem, which is similar for most databases.
Run a SQL query in Metabase against select * from `dataset.table` limit 1
Check the logs during sync, just like the troubleshooting also says.

@flamber
thank you very much for your answer..
after I try your advise, now I get error message :

403 Forbidden POST https://www.googleapis.com/bigquery/v2/projects/bifbi-humantechno/queries { "code" : 403, "errors" : [ { "domain" : "global", "message" : "Access Denied: Project bifbi-humantechno: User does not have bigquery.jobs.create permission in project bifbi-humantechno.", "reason" : "accessDenied" } ], "message" : "Access Denied: Project bifbi-humantechno: User does not have bigquery.jobs.create permission in project bifbi-humantechno.", "status" : "PERMISSION_DENIED" }

Please suggest the solution
Thank you very much

Regards
Taufik

@taufik This is the error:

Access Denied: Project bifbi-humantechno:
User does not have bigquery.jobs.create permission in project bifbi-humantechno

Try creating a new service account, otherwise you'll find better help in a BigQuery specific forum, since it's not a problem specific to Metabase.

@flamber
Try creating new service in metabase? or in bigquery
do you think i have to setup new metabase with gmail email instead of my company email? since bigquery can't give permission to company email ?

Thank you
Regards

@taufik You are misunderstanding how permissions works on BigQuery. A "Service Account" is the credentials used to connect to BigQuery https://cloud.google.com/bigquery/docs/authentication
Contact the person who managed your BigQuery and ask them for help.
Your login on Metabase has no influence on database connection credentials.

1 Like

@Flamber
Thank you very much for your guidance.
Now I have success to read the table from bigquery.
I'm really satisfied that very easy to work from excel sheet to bigquery to Metabase.
Really grateful and enjoy exploring the new version of metabase that I just upgraded.

Best Regards
Taufik Singgih
Indonesia

Thanks a lot
I was looking into permission issues inside Google Cloud

But actually I just needed to share the spreadsheet with the service account