试图从BigQuery获取数据时,Vertex AI管道正在失败

发布于 2025-01-21 17:28:11 字数 484 浏览 2 评论 0原文

我正在尝试运行Google Vertex AI管道,以从BigQuery表中查询。在管道中,我使用的是正确的项目和服务帐户(其中有bigquery.jobs.create访问)。但是我看到它运行时,它正在访问另一个项目E1CD7306FB577E88GQ-UQ。我无法弄清此项目的来源。我正在从顶点AI用户托管笔记本运行管道

pandas_gbq.exceptions.GenericGBQException: Reason: 403 POST https://bigquery.googleapis.com/bigquery/v2/projects/e1cd7306fb577e88gq-uq/jobs?prettyPrint=false: Access Denied: Project e1cd7306fb577e88gq-uq: User does not have bigquery.jobs.create permission in project e1cd7306fb577e88gq-uq.

I am trying to run a Google Vertex AI pipeline to query from a BigQuery table. In the pipeline, I am using the right project and the service account(which has bigquery.jobs.create access). But I see when it runs, it is accessing another project e1cd7306fb577e88gq-uq. I am not able to figure out where from this project is coming from. I am running the pipeline from Vertex AI user managed notebook

pandas_gbq.exceptions.GenericGBQException: Reason: 403 POST https://bigquery.googleapis.com/bigquery/v2/projects/e1cd7306fb577e88gq-uq/jobs?prettyPrint=false: Access Denied: Project e1cd7306fb577e88gq-uq: User does not have bigquery.jobs.create permission in project e1cd7306fb577e88gq-uq.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

や三分注定 2025-01-28 17:28:11

运行代码的服务代理或服务帐户确实具有所需的许可,但是您的代码正在尝试访问错误项目中的资源。由于顶点AI运行您的培训代码的方式,如果您在代码中未明确指定项目ID或项目编号,则可能会无意间发生此问题。

您可以明确选择所需的项目:

import os

from google.cloud import bigquery

project_number = os.environ["CLOUD_ML_PROJECT_ID"]

client = bigquery.Client(project=project_number)

您可以阅读有关培训代码要求的更多信息在这里

The service agent or service account running your code does have the required permission, but your code is trying to access a resource in the wrong project. Due to the way Vertex AI runs your training code, this problem can occur inadvertently if you don't explicitly specify a project ID or project number in your code.

You can explicitly select the project you want this way:

import os

from google.cloud import bigquery

project_number = os.environ["CLOUD_ML_PROJECT_ID"]

client = bigquery.Client(project=project_number)

You can read more about training code requirements here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文