0

I have a BigQuery table that references a Google Sheet document that my service account can't access. Currently getting

"Error: Not found: Files /gdrive/id/xxxx"

I'm using the NodeJs 3.0.0 client library to access the BigQuery API.

The service user account has Data Editor, Job User and User rights on BigQuery and I have explicitly shared the google sheet to the service account.

For clarity, the user account has no issues querying other tables that it has access to, just a bunch of these external tables.

Any thoughts on what else I might need to do?

Tamir Klein
  • 3,514
  • 1
  • 20
  • 38
tazy7
  • 58
  • 5
  • I believe this post will help: https://stackoverflow.com/questions/40391128/how-do-i-authenticate-a-service-account-to-make-queries-against-a-gdrive-sheet-b – Eric Keen Apr 29 '19 at 10:27
  • I am passing the scope drive.readonly scope into the BigQuery client: `const bigquery = new BigQuery({scopes: ['https://www.googleapis.com/auth/bigquery', 'https://www.googleapis.com/auth/drive.readonly']});` Drive API is enabled on "Project A" also I have just enabled Domain-wide delegation to the service account but none of this is has resolved the issue. The delegated user option in that post isn't possible for the NodeJs client (the scopes option has only recently been added). – tazy7 Apr 29 '19 at 11:27

1 Answers1

1

After going back through this from the start it turns out the issue was due to Google Doc editor being disabled at an organisation level. This affects both normal users and service accounts. Also ensuring that Domain-wide delegation was in place heped resolved this.

tazy7
  • 58
  • 5