2017-03-31 60 views
1

quickstart for gcp dataflow here允許用戶寫訪問GCP數據流項目

我使用這個命令

declare -r PROJECT="beam-test" 
declare -r BUCKET="gs://my-beam-test-bucket" 

echo 
set -v -e 

python -m apache_beam.examples.wordcount \ 
    --project $PROJECT \ 
    --job_name $PROJECT-wordcount \ 
    --runner DataflowRunner \ 
    --staging_location $BUCKET/staging \ 
    --temp_location $BUCKET/temp \ 
    --output $BUCKET/output 

導致此錯誤執行example script here

時遇到以下錯誤:

http_response.request_url, method_config, request) 
apitools.base.py.exceptions.HttpError: HttpError accessing <https://dataflow.googleapis.com/v1b3/projects/beam-test/locations/us-central1/jobs?alt=json>: response: <{'status': '403', 'content-length': '284', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'transfer-encoding': 'chunked', 'vary': 'Origin, X-Origin, Referer', 'server': 'ESF', '-content-encoding': 'gzip', 'cache-control': 'private', 'date': 'Fri, 31 Mar 2017 15:52:54 GMT', 'x-frame-options': 'SAMEORIGIN', 'alt-svc': 'quic=":443"; ma=2592000; v="37,36,35"', 'content-type': 'application/json; charset=UTF-8'}>, content <{ 
    "error": { 
    "code": 403, 
    "message": "(f010d95b3e221bbf): Could not create workflow; user does not have write access to project: beam-test Causes: (f010d95b3e221432): Permission 'dataflow.jobs.create' denied on project: 'beam-test'", 
    "status": "PERMISSION_DENIED" 

我已經啓用該項目的DataFlow api。我已經通過該項目的所有者賬戶(我認爲它具有完全訪問權限)授權gcloud cli。

如何&我在哪裏啓用寫入權限?

回答

1

您是否嘗試過運行gcloud auth login以確保您擁有有效的憑證?

如果是,您的默認雲項目可能與您運行Dataflow的項目不同。要更改默認項目,可以運行gcloud init

讓我知道如果沒有解決它。

+0

這不會解決它。 'gcl​​oud init'顯示'項目=梁test' 這已經是該項目中,我得到的錯誤: '用戶不必項目的寫訪問:梁test' 我發現了錯誤:我是使用項目名稱,我應該使用項目ID – slcott

2

變化$PROJECT=project-name$PROJECT=project-id

相關問題