Help! GCP and BigQuery Newbie here ...
I am trying to load a local CSV file into a BQ table; I keep getting "Media upload
not authorized" errors when I run the "bq" command.
In IAM, I am listed as the "owner" of the project I want to upload the table to.
Not sure which permissions are missing in IAM.
Here is the command I am attempting:
C:\Projects>bq --project_id chase-transaction-history load
--skip_leading_rows 1
--autodetect --replace
--source_format CSV chase_transactions_dataset.transaction_item Chase6029_Activity_20160820.CSV
BigQuery error in load operation: Access Denied: Job chase-transaction-
history:aws-us-east-1.bqjob_r31b840219a033810_0000018aaeacef05_1: Media upload
not authorized
Solved! Go to Solution.
This is a bug, account owner not allowed to upload? confirmed changing regions worked without any other changes
The "Media upload not authorized" error means that the service account that is running the BigQuery load job does not have permission to upload the CSV file to Cloud Storage.
Possible reasons for this include:
roles/storage.objectCreator
role for the Cloud Storage bucket that contains the CSV file.roles/bigquery.dataEditor
role for the BigQuery dataset that you are trying to load the data into.roles/bigquery.jobUser
role for the BigQuery project that you are running the load job in.To troubleshoot the issue:
roles/storage.objectCreator
role for the Cloud Storage bucket that contains the CSV file.roles/bigquery.dataEditor
role for the BigQuery dataset that you are trying to load the data into.roles/bigquery.jobUser
role for the BigQuery project that you are running the load job in.To grant these permissions, you can use the Google Cloud IAM console or the gcloud command-line tool.
Once you have granted the necessary permissions, you should be able to run the BigQuery load job without getting the "Media upload not authorized" error.
I am also a newbie, but i see the issue is not related to the above permission that is being mentioned.
I resolved the issue by changing the region of the dataset from useast to iowa. I didn't change any of the permission, it did work.
May be an issue with Region, even i couldn't able to create a empty table on east region.
Thank you!
This is a bug, account owner not allowed to upload? confirmed changing regions worked without any other changes