工作流程失败。原因:刷新您的凭据时出现问题

时间:2019-02-25 13:37:35

标签: google-cloud-platform google-cloud-dataflow service-accounts dataflow google-iam

我的数据流有问题,我需要执行作业,并且收到以下错误:

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.

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

Service account

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

致谢

1 个答案:

答案 0 :(得分: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