16

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.

claudiadast
  • 419
  • 1
  • 9
  • 18

2 Answers2

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
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