1

我的数据流有问题,我需要执行一项作业,但出现以下错误:

Workflow failed. Causes: There was a problem refreshing your credentials. Please check:
1. Dataflow API is enabled for your project.
2. There is a robot service account for your project:
service-[project number]@dataflow-service-producer-prod.iam.gserviceaccount.com should have access to your project. If this account does not appear in the permissions tab for your project, contact Dataflow support.

我已经创建了服务帐户并在项目中获得了许可。

服务帐号

所以我仍然无法识别这个错误。我已禁用 Dataflow API 并重新激活,但仍然没有。或者是否可以重新生成此服务帐户以执行作业?

问候

4

1 回答 1

0

将服务帐户电子邮件添加到PipelineOptions 的service_account_email选项中。

 def get_pipeline_options(self):
      options = PipelineOptions( )

      gcp_options                                   = options.view_as( GoogleCloudOptions )
      gcp_options.job_name                          = "sampleflow"
      gcp_options.project                           = "etldemo-000000"
      gcp_options.staging_location                  = "gs://<bucket name>/stage"
      gcp_options.temp_location                     = "gs://<bucket name>/tmp"
      gcp_options.service_account_email             = "etldemo@etldemo-000000.iam.gserviceaccount.com"
      options.view_as( StandardOptions ).runner     = 'DataflowRunner'

      return options
于 2019-08-22T14:15:24.693 回答