我正在尝试通过云DataFlow教程。我可以在本地运行它以前我能够远程执行它,但今天我开始收到以下错误。
我正在运行
mvn compile exec:java \
-Dexec.mainClass=com.example.WordCount \
-Dexec.args="--project=list-cleaner\
--stagingLocation=gs://disismybucket/staging/ \
--output=gs://disismybucket/output \
--runner=DataflowRunner"
获得以下内容 -
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "usageLimits",
"message" : "Dataflow API has not been used in project 563584335869 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/dataflow.googleapis.com/overview?project=563584335869 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"reason" : "accessNotConfigured",
"extendedHelp" : "https://console.developers.google.com"
} ],
"message" : "Dataflow API has not been used in project 563584335869 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/dataflow.googleapis.com/overview?project=563584335869 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status" : "PERMISSION_DENIED"
}
这显然是一个身份验证问题,但我已经为GOOGLE_APPLICATION_CREDENTIALS正确设置了我的环境变量,并确保我的项目名称正确无误。我已禁用并重新启用此项目的api无济于事。奇怪的是,引用的项目ID不是我的项目之一,而是一个似乎出现在其他支持问题中的项目编号。我也尝试过使用python SDK,但也没有运气。任何帮助表示赞赏。
答案 0 :(得分:2)
因为我担心这很简单,我是个白痴。您的评论让我更加注重设置GOOGLE_APPLICATION_CREDENTIALS时所做的工作。我设置它GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json"
,但我没有将它导出到全局范围,即导出GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json"
我会说这是奇怪的行为,而不是抛出有关丢失的凭据的错误,它默认为一些随机帐户