cancel
Showing results for 
Search instead for 
Did you mean: 

Cloud Foundry: Application Router HTTP 502 After 2 minutes

former_member231229
Participant
0 Kudos

Hello Community,

We are experiencing an issue while using the AppRouter as a reverse proxy in the SCP Cloud Foundry environment.

We are proxying a long running call to a Java backend service via approuter:

https://approuter.cfapps.eu10.hana.ondemand.com/endpoint -> https://service1.cfapps.eu10.hana.ondemand.com/endpoint

This call drops after exactly 2 minutes with a "502 Bad Gateway: registered service failed to handle the request", whereas if we call the service directly, it works without issues.

We tried to increase the timeout in the mapped destinations in AppRouter's manifest.yaml file, as well as increase the memory dedicated for the application from 256M to 512M.

I cannot see any particular error message, nor any blocking exceptions in the backend service.

It still seems to me a problem with the timeout as, even if we set the "timeout" property to 360000 (6 minutes), the connections is always dropped after exactly 2 minutes.

Any ideas?

For your reference, both xs-app.json and manifest.yaml are pasted below.

Thanks in advance for any help,

Roberto

xs-app.json file:

{
  "welcomeFile": "index.html",
  "authenticationMethod": "route",
  "routes": [{
    "authenticationType": "xsuaa",
    "source": "^/cruscotto/*",
    "target": "/employee/",
    "destination": "service-1",
    "scope": "$XSAPPNAME.Display",
    "csrfProtection": false,
    "httpMethods": ["GET"]
  }]
}

manifest.yaml file:

---
applications:
  - name: approuter
    routes:
      - route: approuter.cfapps.eu10.hana.ondemand.com
    path: approuter
    memory: 512M
    buildpacks:
      - nodejs_buildpack
    env:
      SESSION_TIMEOUT: 60
      destinations: >
        [
          {
            "name":"service-1",
            "url" : "https://service-1.cfapps.eu10.hana.ondemand.com" ,
            "forwardAuthToken": true,
            "timeout": 360000
          }
        ]
    services:
      - ig-xsuaa
      - ig-destination
      - ig-app-logs

Accepted Solutions (1)

Accepted Solutions (1)

joachimvanpraet
Active Participant

Hi r.pagni ,

I think you have to increase the value of the INCOMING_CONNECTION_TIMEOUT environment variable.

"Maximum time in milliseconds for a client connection. After that time the connection is closed. If set to 0, the timeout is disabled. Default: 120000 (2 min)"

cf set-env <SAPROUTER_APP_NAME> INCOMING_CONNECTION_TIMEOUT 3600000

kr,

Joachim

former_member231229
Participant
0 Kudos

Thank you joachim.vanpraet
I will give it a try and post the results!

Have a nice day and Merry Christmas!

Br,
Roberto

Answers (0)