BigQuery error · Permissions and access
Permission bigquery.tables.get denied on table
The caller asked for a table's metadata (schema, size, existence) without the bigquery.tables.get permission, or the table isn't there. Tools trigger it more often than queries: connectors, dbt, bq show and client get_table calls. Grant BigQuery Metadata Viewer or Data Viewer on the table or dataset.
The error message
Access Denied: Table <project>:<dataset>.<table>: Permission bigquery.tables.get denied on table <project>:<dataset>.<table> (or it may not exist).
Causes
A tool reads table metadata before using it
Spark and Dataflow connectors, dbt, Feast, BI tools and client libraries call tables.get to read the schema or check that the table exists. The call fails even if the principal could run jobs in the project.
Only job or project-level roles were granted
BigQuery Job User and BigQuery User let you create jobs, but bigquery.tables.get on another dataset comes from roles such as BigQuery Metadata Viewer, Data Viewer, Data Editor or Data Owner.
Wrong table name, project or region
"Or it may not exist" means BigQuery won't confirm existence to a principal without access. Check spelling, letter case, and the project in the reference; a missing project prefix makes the client look in its default project.
The dataset-level variant
Listing or opening a dataset without access returns Access Denied: Dataset <project>:<dataset>: Permission bigquery.datasets.get denied on dataset <project>:<dataset> (or it may not exist). The fix is the same, granted on the dataset.
How to fix it
1. Grant metadata access, or data access if the tool also reads rows
BigQuery Metadata Viewer is enough for schema and existence checks. Connectors that then read the data need BigQuery Data Viewer, which includes both bigquery.tables.get and bigquery.tables.getData.
GRANT `roles/bigquery.dataViewer`
ON SCHEMA `acme-analytics.marketing`
TO "serviceAccount:spark-jobs@acme-analytics.iam.gserviceaccount.com";2. Check which identity the tool really uses
Connectors often run as the cluster's or worker's service account, not as you. Look up protoPayload.authenticationInfo.principalEmail in the failed audit log entry to see the principal.
3. Use fully qualified names
Reference tables as project.dataset.table in tool configuration so the client doesn't resolve them in its default project.
How to prevent it
- Grant connector and tool service accounts dataset-level roles explicitly when you onboard the tool.
- Grant to groups, not individuals, so access survives team changes.
- Read the permission name in the message:
tables.get(metadata) andtables.getData(rows) are fixed by different roles.
FAQ
What is the difference between bigquery.tables.get and bigquery.tables.getData?
tables.get reads the table resource: schema, description, size and options. tables.getData reads the rows, which queries and exports need. Metadata Viewer has only the first; Data Viewer has both.
Does this error cost anything?
No. It comes from a metadata API call or from a job that fails authorization; no data is read and nothing is billed.
Related
SQL reference
More permissions and access
All BigQuery error messages · What 50M daily events say about BigQuery failures
