Seeing a 504 Gateway Timeout within 15 seconds

I have a proxy where when I send in invalid values I get back the error instantly. But when I send in correct values the Apigee throws a gateway timeout error with an error code 504.

As per this link, I have set all the timeout values to absurd levels and still see the exact same error (504 Gateway Timeout. Is there an admin level setting which is overriding my timeout values?

Any help/suggestions welcome.

Thanks,

Girish

0 7 3,899
7 REPLIES 7

Not applicable

not an attempt at an answer - just a suggestion that might help: have you tried to use a trace to see if you can see what is going on?

I tried the trace and that is where I see the gateway timeout within 15 seconds. I have created a test proxy where the traffic is straight pass-thru (no policies attached).

Attached screenshot. (Hiding the client specific details)

Not applicable

Hi @Girish Gajria , what is your backend ?

Can you directly hit the backend and see what response you getting for the same request ?

Hello @Maruti Chand

Its a client service where Apigee IP addresses are whitelisted. So I cannot hit the service directly from my local workstation.

However, the same service is being called in another proxy from within Node.js and it seems to be working correctly there. Please note its a mutual SSL endpoint with Keystore setup on Apigee.

SSL connection works fine. When I send in invalid values, it responds immediately from the target. But when I send in seemingly valid values it times out always around 15 seconds even though I have below code on the target endpoint configuration (timeouts are set this high only for debug).

            <Property name="io.timeout.millis">600000</Property>
            <Property name="success.codes">5XX,4XX,3XX,2XX,1XX</Property>
            <Property name="connect.timeout.millis">600000</Property>
            <Property name="keepalive.timeout.millis">600000</Property>

So are there any additional timeout settings (admin level) within Apigee that could be overriding the above endpoint configuration?

Thanks,

Girish

HI,

I am having same problem as above, the only response i am getting from apigee backend is timeout. I have created the proxy for apigee service to SetDeveloperStatus. When i directly hit backend its working. But when i hit my proxy api, i am getting timeout. Anybody have any solution to this?

-

Amol

sarthak
Participant V

Hi @amol.deshmukh what you described is most commonly attributed to Apigee not able to reach the backend service for some reason.

Some common reasons why it may happen are :

the backend expects IP whitelisting of the client IPs and Apigee is not whitelisted

SSL handshake is failing - might be for either 1 way or mutual SSL .

What do you see when you run trace ? Can you see if the request is hung for sometime before timing out or you are getting something like "Connection refused" from the backend ?

increase your keepalive and timeout properties values then it should be good to get response back from your target server.

add below properties into your target proxies property.

<Property name="response.streaming.enabled">true</Property> <Property name="request.streaming.enabled">true</Property> <Property name="io.timeout.millis">500000</Property> <Property name="keepalive.timeout.millis">500000</Property> <Property name="connect.timeout.millis">500000</Property>