Suddenly receiving an error all day with no changes to my source from when it worked yesterday.
Receiving this when making the generateContent call from Android firebase.vertexai.GenerativeModel
Error: Unexpected Response:
{
“error”: {
“code”: 400,
“message”: “Service agents are being provisioned (Vertex AI access control with IAM | Google Cloud). Service agents are needed to read the Cloud Storage file provided. So please try again in a few minutes.”,
“status”: “FAILED_PRECONDITION”
}
}
kotlinx.serialization.MissingFieldException: Field ‘details’ is required for type with serial name ‘com.google.ai.client.generativeai.common.server.GRpcError’, but it was missing at path: $.error
I’m experiencing a very similar error.
I’m calling the gemini-1.5-pro-001:generateContent endpoint (full endpoint) from Postman.
This API request was repeatedly run successfully up until 8/16. I went to re-test it today (9/5), and got the below error.
{
“error”: {
“code”: 400,
“message”: “Service agents are being provisioned (Vertex AI access control with IAM | Google Cloud). Service agents are needed to read the Cloud Storage file provided. So please try again in a few minutes.”,
“status”: “FAILED_PRECONDITION”
}
}
I’ve waited about an hour now, and the error is still the same.
Does anyone have any guidance on whether or not these “service agents” are actually being provisioned or this is some other kind of underlying error?
@David_Howe by God’s grace I was able to solve the issue by manually triggering the creation of a Vertex AI Service Agent from the Cloud Shell.
To access the Cloud Shell click on this icon in your Google Cloud Project (GCP)
near the top right of the page.
I’m not sure which command finally triggered the Vertex AI Service Agent, so I’ll provide all the commands I tried, and you can try yourself.
gcloud ai-platform models create test_model
- just randomly creating something|
gcloud services list --enabled | grep aiplatform
gcloud ai endpoints list --region=us-central1
gcloud projects get-iam-policy $(gcloud config get-value project) --flatten=bindings[].members --format=table(bindings.role,bindings.members) --filter=bindings.members:service-*@gcp-sa-aiplatform.iam.gserviceaccount.com
gcloud ai tensorboards create --display-name=test-tensorboard --region=us-central1
- just randomly creating something|
I verified that the Service Agent had been created by going to my GCP > IAM, checking the “Include Google-provided role grants” box, and finding a principal with the format service-[YOUR_PROJECT_NUMBER]@gcp-sa-aiplatform.iam.gserviceaccount.com
.
Now my API request works in Postman and in my code.
Hope this helps!
2 Likes
@Samuel_Kuhn
You sir are an absolute legend. I got mine working now thanks to you. I only ran the following two commands and it worked:
gcloud services list --enabled | grep aiplatform
gcloud ai endpoints list --region=us-central1