7

I am following the tutorial here (https://cloud.google.com/ai-platform/training/docs/training-jobs#python_1) and using Python to deploy a machine learning model to Google cloud for training. However, I got HttpError 403: "Permission denied on resource project my_project." The reason for the error is "CONSUMER_INVALID." Specifically, the returned metadata shows that the consumer is "projects/my_project," and the service is "ml.googleapis.com".

I went to the AI platform and my project is indeed there. The API I am requesting to use is enabled for the project and the environment variable GOOGLE_APPLICATION_CREDENTIALS has been set correctly. I am wondering how to fix the problem. Thanks!

Xi Liu
  • 559
  • 9
  • 18

1 Answers1

10

I ran into this issue when I used my literal Project Name. I had to instead use the 'ProjectID' which is listed in the 'Home' Dashboard, in the 'Project info' widget.

Recluse0000
  • 119
  • 1
  • 6
  • This helped me, Google has wrong instructions. Following your comment I just replaced the 'project id' and used the 'project number' instead and now it works. Thank you – Adel Mourad Jan 14 '23 at 11:05
  • Thanks! I found that that when using gcloud auth application-default set-quota-project we need to use the ProjectID from the Home dashboard but I was still stuck at this since I still had to update the ProjectID on my code. – Andresa Martins Apr 04 '23 at 20:02