简体   繁体   English

GCP 数据流刷新您的凭据时出现问题

[英]GCP Dataflow There was a problem refreshing your credentials

I'm trying to create a dataflow in Java with Gradle.我正在尝试使用 Gradle 在 Java 中创建数据流。 I've created a gradle task to upload the job to GCP via the DataflowRunner and set my credentials via environment "GOOGLE_APPLICATION_CREDENTIALS", "....json" , but when I view the job, all I see is:我创建了一个 gradle 任务以通过DataflowRunner将作业上传到 GCP 并通过environment "GOOGLE_APPLICATION_CREDENTIALS", "....json"设置我的凭据,但是当我查看作业时,我看到的是:

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.

I've already made sure the dataflow API is enabled for my project and that the service account exists and has editor and Cloud Dataflow Service Agent roles.我已经确保为我的项目启用了数据流 API 并且服务帐户存在并且具有editor者和Cloud Dataflow Service Agent角色。 I've tested with my code and the sample code on the getting started page, same issue.我已经用我的代码和getting started页面上的示例代码进行了测试,同样的问题。

When you first use Dataflow in a new GCP project, you need to enable the API (Step 3 in the Quickstart), it could take few minutes.当您第一次在新的 GCP 项目中使用 Dataflow 时,您需要启用 API(快速入门中的第 3 步),这可能需要几分钟时间。 During this step a couple of service accounts are created:在此步骤中,会创建几个服务帐户

Cloud Dataflow service account: service-<project-number>@dataflow-service-producer-prod.iam.gserviceaccount.com . Cloud Dataflow 服务帐号: service-<project-number>@dataflow-service-producer-prod.iam.gserviceaccount.com

Controller service account: <project-number>-compute@developer.gserviceaccount.com . Controller 服务帐户: <project-number>-compute@developer.gserviceaccount.com

The first account is the one in the error.第一个帐户是错误中的帐户。 I would think that you have not enabled the Dataflow API or you executed the job while the API was being enabled.我认为您尚未启用数据流 API 或者您在启用 API 时执行了该作业。 As you mentioned you verified this, the nex step is checking if the default service accounts were modified, let's say, they were recreated or the default permissions changed.正如您所提到的,您验证了这一点,下一步是检查默认服务帐户是否已修改,例如,它们是否已重新创建或默认权限已更改。 These revisions also apply for the Controller service account.这些修订也适用于 Controller 服务帐户。

In addition, please don't forget to assign the proper permissions to the account that execute the Dataflow job.此外,请不要忘记为执行 Dataflow 作业的帐户分配适当的权限

UPDATE:更新:

If the issue persists, it is probable that the service accounts were corrupted somehow, in which case, it is recommended to create a new GCP project with fresh service accounts or Contact Cloud Support .如果问题仍然存在,很可能是服务帐户以某种方式损坏,在这种情况下,建议使用新的服务帐户或联系云支持创建一个新的 GCP 项目。

This issue can be triggerd if the Compute Engine default service account in the Google Cloud project is disabled:如果 Google Cloud 项目中的 Compute Engine 默认服务帐户被禁用,则可能会触发此问题: 在此处输入图像描述

The status should show a green tick.状态应显示绿色勾号。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM