BigQuery CLI fails to access Google Sheets table: OAuth token scope issue

The bq command on a Google Sheets table returns ‘Access Denied: No OAuth token with Google Drive scope’ error. How can I resolve this?

I encountered a similar issue when trying to access Google Sheets through the BigQuery CLI. The root cause was insufficient OAuth scopes for the credentials. To fix this, I revoked my current credentials, re-authenticated with the command ‘gcloud auth login --enable-gdrive-access’, and set my active account using ‘gcloud config set account [email protected]’. After these adjustments, I was able to query Google Sheets tables without errors. If the error persists, double-check your IAM permissions in both BigQuery and Google Drive to ensure proper access.

I encountered a similar issue in the past. It turned out that the error was due to insufficient OAuth scopes on your token. The recommended fix is to revoke your current credentials, then re-authenticate using ‘gcloud auth login --enable-gdrive-access’, and finally set your active account.

If that approach doesn’t resolve the issue, make sure that your service account has the proper permissions not only in BigQuery but also in Google Drive. In some cases, granting the correct roles or even setting up a new service account with the required scopes can be the solution.

yo, had this prob too. check ur oauth scopes, they might be too limited. try revoking ur creds and re-auth with ‘gcloud auth login --enable-gdrive-access’. then set ur active account. if that dont work, maybe ur IAM perms are messed up? good luck!