2

I'm trying to use bigrquery from an interactive R session for the first time. I've installed the R bigrquery package and successfully established a connection. I've authenticated following a redirect from the interactive RStudio session to the web browser for login, so oauth seems to be working correctly. However, when I try to run a query, such as DBI::dbReadTable(con, "A549_raw_merged_TADs")[1:6, ], I get the error Error: The project variant-annotation has not enabled BigQuery. [invalid].

I am sure I need to enable something else in the project on the Google side, but I'm not sure what I need to enable, or how to do that from the web console interface.

Is this documented anywhere, or can anyone here give me instructions?

Note: I have confirmed that the BigQuery API has Activation status of Enabled via the console at https://console.cloud.google.com/apis/api/bigquery-json.googleapis.com/overview, so although my question is the same as Error processing job: Project has not enabled BigQuery, the issue appears to be different.

Additional information: when I check the BigQuery API status via the console link above, there's a notification that "To use this API, you may need credentials. Click 'Create credentials' to get started."

So it may be that my assumption that oauth seems to be working is not correct.

user513951
  • 12,445
  • 7
  • 65
  • 82
bheavner
  • 519
  • 1
  • 4
  • 20
  • That console says the activation status is enabled, but there's a message "To use this API, you may need credentials. Click 'Create credentials' to get started." So perhaps the oauth is not sufficient? – bheavner Mar 06 '19 at 21:01
  • 2
    you can enable the BigQuery API with this command `gcloud services enable bigquery.googleapis.com`, but, since you mention it is already enabled, I wonder if you are pointing at the correct project. Is "variant-annotation" your project's id? – ch_mike Mar 06 '19 at 21:11
  • Ah! That may be the key - that's the project's name! The id is the name followed by some numbers! With the correct project id, I get a `Auto-refreshing stale OAuth token.` Followed by a different error to track down - dataset not found. Thanks! If you submit your comment as an answer, I'll mark it accepted! – bheavner Mar 06 '19 at 21:15
  • Possible duplicate of [Error processing job: Project has not enabled BigQuery](https://stackoverflow.com/questions/41448606/error-processing-job-project-has-not-enabled-bigquery) – user513951 Jun 25 '19 at 03:35

1 Answers1

3

You can enable the BigQuery API with this command gcloud services enable bigquery.googleapis.com, but, since you mention it is already enabled, you may be pointing to a different project.

Feel free to ping me on a new thread if you require assistance on the new issue.

ch_mike
  • 1,556
  • 6
  • 11
  • Thanks, I got the dataset not found error straightened out, too. Cheers! – bheavner Mar 06 '19 at 21:25
  • @bheavner how did you resolve this issue? I am experiencing an error where google cloud is pointing to the wrong project for some reason – Megan Dec 06 '19 at 22:08
  • @Megan The answer to the "wrong project" question is [here](https://stackoverflow.com/a/55080960). – user513951 Jun 10 '20 at 07:17