Deadline Exceeded (30s) for Vertex AI Image Generation Predict Endpoint / Need Configurable Setting
Please make sure you have searched for information in the following guides.
- [X] Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- [X] Check our Troubleshooting guide: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/troubleshooting
- [X] Check our FAQ: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/faq
- [X] Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- [X] Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- [X] Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
Documentation Request
Deadline Exceeded (30s) for Vertex AI Image Generation Predict Endpoint / Need Configurable Setting
Error: 4 DEADLINE_EXCEEDED: Deadline exceeded after 30.000s,name resolution: 0.270s,metadata filters: 0.001s,LB pick: 0.269s
Client - PredictionServiceClient from @google-cloud/aiplatform.
const client = new PredictionServiceClient({
apiEndpoint: _model.model_base_url,
credentials: json_key,
projectId: `${json_key.project_id}`,
});
const endpoint = `projects/${json_key.project_id}/locations/us-central1/publishers/google/models/imagegeneration@006`;
const instance = helpers.toValue({
prompt: transformedRequest.prompt
});
const parameters = helpers.toValue({
sampleCount: transformedRequest.n,
aspectRatio: transformedRequest.aspectRatio,
includeRaiReason: true,
includeSafetyAttributes: true,
safetySetting: "block_few",
outputOptions: {
mimeType: "image/png"
}
});
const response = await client.predict({
endpoint,
instances: !_.isNil(instance) ? [instance] : [],
parameters
});
The gRPC call times out after 30 seconds. I am not sure if this is a hard limitation set by Vertex AI or if it's a client limitation. What's the best way to proceed forward here?
cc @ddelgrosso1
Facing same issue
Could you try increasing the timeout, described in CallOptions?
This has been closed since a request for information has not been answered for 15 days. It can be reopened when the requested information is provided.
add timeout in ms to predict CallOptions:
const response = await client.predict({
endpoint,
instances: !_.isNil(instance) ? [instance] : [],
parameters
}, {
timeout: 60000,
});