简体   繁体   English

使用 R 连接到 BigQuery 时,访问被拒绝

[英]Keep getting Access Denied when connecting to BigQuery with R

I am very new to GCP and BigQuery and I am trying to query a simple dataset that I have uploaded on Google BigQuery by using R. In the IAM settings, I am listed as an "BigQuery Admin", "BigQuery Data Owner" and "Owner."我是 GCP 和 BigQuery 的新手,我正在尝试使用 R 查询我上传到 Google BigQuery 的简单数据集。在 IAM 设置中,我被列为“BigQuery Admin”、“BigQuery Data Owner”和“所有者。”

I can also query the dataset using the console, but every time I keep getting an我也可以使用控制台查询数据集,但每次我不断收到

access denied, User does not have bigquery.jobs.create permission in project ABCD

Here is my code:这是我的代码:

library("tidyverse")
library("bigrquery")
bq_auth(use_oob = TRUE)


# Store the project id
projectid = "ABCD"

# Set your query
sql <- "SELECT * FROM test.testtable"

# Run the query and store the data in a dataframe
mydf <- query_exec(sql, projectid, use_legacy_sql = FALSE)

# Print the query result
mydf 

All the sources I have found so far tell me to activate the setting for Big Query in the IAM settings - but I have already done it, so I am at a loss on what to do further.到目前为止,我找到的所有资源都告诉我在 IAM 设置中激活 Big Query 的设置——但我已经完成了,所以我不知道该怎么做。 Would appreciate the help!非常感谢您的帮助!

OK, I was really dumb.好吧,我真的很笨。 The project name is a combination of letters and numbers, but this on the top left of the cloud console only the letters are being shown.项目名称是字母和数字的组合,但是云控制台的左上角只显示字母。 I had forgotten to put the numbers in the projectId and this is why it was not working (I was not referring to the proper project).我忘了把数字放在 projectId 中,这就是它不起作用的原因(我没有指代正确的项目)。

Hope that saves someone else the hassle!希望能为别人省去麻烦!

This definetly seems to be a permission issue.这显然是一个许可问题。 Can you make sure that this program is using your credentials not some other service account credentials?你能确定这个程序使用的是你的凭据而不是其他一些服务帐户凭据吗?

If you are running from your laptop, you can run gcloud auth list to find out the credential in use.如果您在笔记本电脑上运行,则可以运行gcloud auth list以找出正在使用的凭据。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在连接 Google BigQuery 时遇到问题 - Getting trouble in connecting with Google BigQuery 通过 SSH 连接服务器时出现错误 Permission denied (publickey) - Getting an error Permission denied (publickey) when connecting the server via SSH 将 App Engine 连接到云 SQL 拒绝访问 - Connecting App Engine to Cloud SQL Access Denied Google BigQuery 中的查询表有错误“访问被拒绝:BigQuery BigQuery:通配文件模式时权限被拒绝。” - Query table in Google BigQuery has error "Access Denied: BigQuery BigQuery: Permission denied while globbing file pattern." 当我在 AWS Amplify 上重新加载我的 React 应用程序时出现“访问被拒绝”错误 - Getting an "Access Denied" error when I reload my React app on AWS Amplify 使用 Dataform 表创建时,我收到错误消息“BigQuery:获取驱动器凭据时权限被拒绝” - With Dataform table creation I get an error "BigQuery: Permission denied while getting Drive credentials" BigQuery:访问被拒绝:用户没有查询表的权限......也许它在美国位置不存在 - BigQuery: Access Denied: User does not have permission to query table... perhaps it does not exist in location US 尝试在 BigQuery 上创建表时收到“意外错误”消息 - Getting "unexpected error" message when trying to create table on BigQuery 尝试从 AWS Lambda 访问 S3 时访问被拒绝 - Access Denied when trying to access S3 from AWS Lambda 尝试使用 onSnapshot 时不断出错 - Keep getting error when trying to use onSnapshot
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM