google-cloud-platformgoogle-bigquerysqlxdataform

With Dataform table creation I get an error "BigQuery: Permission denied while getting Drive credentials"


I am using Dataform to create a table on a dataset that I have created on a Google Cloud project, but I get this error:

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

Why? What should I do about this?

In a compiled version of a sqlx dataform file I try to create or replace a table.

CREATE OR REPLACE TABLE my_project_id.my_data_set.my_table

I'm not using a table that reads something from Google Drive but I am creating a new one. The service account associated with my dataform project has Dataset Owner access rights to my_data_set, and interestingly the dataform project is able to create views, but not tables.


Solution

  • I finally found a solution to this problem. To solve this problem one has to do this:

    1. Check all the source tables that the dataform project has.
    2. If any of the source tables is based on a Google Drive data, such as Google Sheet, give the service account associated with the dataform project view access to it.

    Interestingly, dataform is not able to create table if it does not have access rights to the source of the tables that it reads.