I was successfully able to launch a dataproc cluster by manually creating one via gcloud dataproc clusters create...
. However, when I try to launch one through a script (that automatically provisions and stops clusters), it says ERROR: (gcloud.dataproc.clusters.create) PERMISSION_DENIED: Permission denied on resource project hail-test-project (#0)
. I don't understand why, because the script uses the same command.
Asked
Active
Viewed 1.5k times
16

claudiadast
- 419
- 1
- 9
- 18
2 Answers
22
One possible reason is you are using a wrong project. You should use your project id, not your project name. Sometimes they are the same, sometimes not. I just met this problem and I think this could be the possible reason, and it will be useful for other people that find this question in the future.

Leonardo Alves Machado
- 2,747
- 10
- 38
- 53

Tc Zhong
- 452
- 4
- 7
-
Works in my case. I just change project name to project id. ``gcloud config set project project-id`` – prasastoadi Sep 03 '18 at 13:50
1
It sounds like the script might be running as a different user than when you run gcloud dataproc clusters create...
manually. gcloud
uses your home directory for configuration, so the body of your script will be dependent on the user it runs as.

Axel Magnuson
- 1,192
- 1
- 10
- 26