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 have the same problem in GCP Vertex AI prompt console. The problem exists if I input video or audio to prompt, while image and pdf work fine without problem.
Failed to submit prompt
Error message: "Service agents are being provisioned (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents). Service agents are needed to read the Cloud Storage file provided. So please try again in a few minutes."
Status: 400 Error code: 9
Request ID: 15926358707855887495
I have tried using the same prompt, the same video, and the same default setting in another GCP account, it is successful. So, I have no idea what’s wrong.
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.
I use the google AI and the answer is using the following command
gcloud beta services identity create --service=aiplatform.googleapis.com --project=PROJECT_ID
This issue has been acknowledged by Google. Strangely only in the context of Firebase though.
I followed the instructions listed there and they worked for me:
Here’s the workaround to fix your project and correctly provision these service agents so that you can start including Cloud Storage for Firebase URLs in your multimodal requests. You must be an Owner on the project, and you only need to complete this set of tasks once for your project.
Access and authenticate with the gcloud CLI.
The easiest way to do this is from Cloud Shell. Learn more in the Google Cloud.
If prompted, follow the instructions displayed in the terminal to make the gcloud CLI run against your Firebase project.You’ll need your Firebase project ID, which you can find at the top of the settings Project settings in the Firebase console.
Provision the required service agents in your project by running the following command:
Wait a few minutes to ensure that the service agents are provisioned, and then retry sending your multimodal request that includes the Cloud Storage for Firebase URL.
If you’re still getting this error after waiting several minutes, reach out to Firebase.