Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unable to call VertexAI Public Endpoint from internal resource (cloud function or cloud run)

Hiya, 

I've deployed a model to a public endpoint on VertexAI. I am able to call this model successfully from Postman and get predictions back in roughly 200ms. 

However, I have tried to call the same endpoint from Cloud Run using Axios and the call hangs indefinitely until the Cloud Run invokation times out after 90s. I have checked the Authorization header generated in Cloud Run and it works totally fine when calling the model endpoint from Postman. I have also tried calling a request catcher from the same cloud run instance to check calls to outside GCP work, and that was successful. Calls to other resources in the project including several cloud functions and cloud run apps are also successful.

Similarly, Ive set up a simple cloud function which calls the endpoint using the aiplatform Python SDK. The exact same thing happens - the request hangs until the cloud function itself times out. This happens whether the endpoint id I provide is correct or not which seems weird - I don't get any error telling me the endpoint does not exist, whereas if I run the exact same code locally I get a 404 immediately.

It feels like this could be a networking issue, but given it is a public endpoint on VertexAI and there are no egress settings on the cloudfunction/cloud run instance I'm not sure what would be causing it! Any ideas on what to try next would be massively appreciated! 

Many thanks, Lucie

 

Update:  Calling the endpoint from the cloud function using `requests` rather than the aiplatform sdk works, but it still hangs using the sdk or from cloud run.

2 1 465
1 REPLY 1

Did you solve this?