user23642640
user23642640

Reputation: 79

403 Permission Denied Error When Accessing Google AI Platform Model

I'm encountering a "403 Permission Denied" error when trying to predict with a model hosted on Google's AI Platform. Here's the error message I received:

PermissionDenied: 403 Permission 'aiplatform.endpoints.predict' denied on resource '//aiplatform.googleapis.com/projects/my-first-rag/locations/us-central1/publishers/google/models/textembedding-gecko@003' (or it may not exist). [reason: "IAM_PERMISSION_DENIED"]

It seems like there's an issue with the permissions set for accessing the model. The model is supposed to exist as it's part of my project named "my-first-rag", and I am trying to use the "textembedding-gecko@003" model in the "us-central1" region.

Can anyone suggest what IAM roles or permissions I need to check or modify to resolve this error? Additionally, if there are any common pitfalls or checks I should perform to ensure the resource is correctly configured and accessible, that would be highly appreciated.

What I've tried:

I've updated the permissions in the service account JSON file, believing this should rectify the permission issues. I expected this to grant the necessary access for the aiplatform.endpoints.predict action on the specified model resource.

What happened instead:

Despite updating the permissions, the "403 Permission Denied" error persists when attempting to access the Google AI Platform model for prediction. It seems that the service account still lacks the appropriate permissions or the resource identifier might be incorrect.

Upvotes: 7

Views: 5254

Answers (1)

liuspatt
liuspatt

Reputation: 21

Add in IAM One of this permissions

  • Vertex AI Service Agent
  • Vertex AI User
  • Vertex AI Custom Code Service Agent

Upvotes: 1

Related Questions