Apigee Proxy Upstream Timeout Error (504 gateway error)

Hello Guys, I have a problem with Apigee Proxies. The Problem is when I create a Proxy for my Google Cloud Function API, which gets me a response in about 30 seconds to 1 minute. So when I call the API with a Apigee Proxy, it will always get me an error after 30 seconds, although I've changed the configurations of the Proxy. The error says: 

"upstream request timeout" and the status in postman says: 504 Gateway Timeout. 

Ich Apigee has some kind of default timeout settings. I have worked with following documentations but couldn't solve the problem:


https://cloud.google.com/apigee/docs/api-platform/errorcatalog/mp-runtime-errorcatalog?

hl=dehttps://cloud.google.com/apigee/docs/api-platform/reference/endpoint-properties-reference?hl=de... 

 

My configurations of the xml of the proxy are like this:

Proxy endpoint:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>AM-</Name>
</Step>
</Request>
<Response/>
</PreFlow>
<Flows/>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<HTTPProxyConnection>
<BasePath>/dev_deploycontracts</BasePath>
<Properties>
<Property name="io.timeout.millis">200000</Property>
</Properties>
</HTTPProxyConnection>
<RouteRule name="default">
<TargetEndpoint>default</TargetEndpoint>
</RouteRule>
</ProxyEndpoint>
 
_______________________________________________
Target endpoint:
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>add-cors</Name>
</Step>
<Step>
<Name>AM-</Name>
</Step>
</Request>
<Response/>
</PreFlow>
<Flows/>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<HTTPTargetConnection>
<URL>example.cloud-function.net</URL>
<Properties>
<Property name="io.timeout.millis">200000</Property>
</Properties>
</HTTPTargetConnection>
</TargetEndpoint>
 
 
I have also tried it with:
  • keepalive.timeout.millis
  • connect.timeout.millis
  • request.streaming.enabled
  • api.timeout
 
I hope you guys can help me to solve this problem and thanks in advance! 🙂
 
Regards
 
Can Özer

@dchiesa1 @dknezic 

1 4 1,251
4 REPLIES 4

The Load Balancer will also have a timeout that usually defaults to 30 seconds. Also, if you're using PSC this timeout cannot be modified (it's locked to 30s)

Were you able to solve this problem.  The debug doesn't even show the 504 and if I leave debug running; it captures the response from the targetserver; but postman still returns a 504 after 30 seonds. (eventhough that 504 never shows up in the debug and after 45 seconds; the debug shows the response from the target with a 200) Unfortunately Postman never gets this response since it already got the 504.

Any ideas?

The GCP Load Balancer isn't accounted for in the Apigee debug, it's outside of that view

gtk - I was able to resolve my problem by running:

gcloud compute backend-services update apigee-backend-service-xxxxxx --global --timeout=180 --project=xxxxxx