nFrain
nFrain

Reputation: 149

Access Denied when trying to run Google bigQuery in Rstudio

I am trying to run a query from Google bigQuery in R and I am receiving the following error:

Error: Access Denied: Job xxxx-xx-xxxx:job_UZyHC59JLjNzJJJqQV-P5MOU2aw: The user does not have permission to run a query in project xxxx-xx-xxxx

The code I used to achieve the error is as follows:

install.packages("bigrquery")
library(bigrquery)
project <- "xxxx-xx-xxxx"
sql <- "SELECT x, y, z FROM tableN WHERE x > 0"
query_exec(sql, project = project)

No authentication option is coming up when I run my script. I am worried that the reason for this may be that I tried to run this query before I had access to the project and that resulted in a failure to authenticate.

I was worried that may have cached and resulted in automatic failure to authenticate. As a result I tried just deleting all of the R files on my computer and reinstalling (seemed quick as I had just completed setup). But this was not successful.

I was unable to find a solution that I could work with.

If anyone has any idea why this might be occurring, your help would be much appreciated.

Thanks.

Upvotes: 1

Views: 1026

Answers (1)

Jeremy Condit
Jeremy Condit

Reputation: 7046

According to https://github.com/hadley/bigrquery:

By default, bigrquery picks up httr's policy of caching per-working-directory credentials in .httr-oauth.

Try looking for and removing that file?

By the way, it shouldn't matter if you didn't have access to the project when you originally authenticated. However, it's possible that you authenticated as another user originally, so reauthenticating might help sort things out.

Upvotes: 1

Related Questions