Diego Migration: 502 Bad Gateway

202 Views Asked by At

I have existing node.js application running on the IBM Bluemix DEA runtime. I have tried to migrate it to the Diego, migration process completed without any errors. But when I am trying application route I am getting '502 Bad Gateway: Registered endpoint failed to handle the request.' error. Migration is done using the "Migrate to Diego" button.

From application console:

7/12/2017 8:59:28 AM    OUT STG Staging complete
7/12/2017 8:59:28 AM    OUT STG Uploading droplet, build artifacts cache...
7/12/2017 8:59:28 AM    OUT STG Uploading build artifacts cache...
7/12/2017 8:59:28 AM    OUT STG Uploading droplet...
7/12/2017 8:59:29 AM    OUT STG Uploaded build artifacts cache (18.2M)
7/12/2017 8:59:34 AM    OUT STG Uploaded droplet (38M)
7/12/2017 8:59:34 AM    OUT STG Uploading complete
7/12/2017 8:59:34 AM    OUT STG Destroying container
7/12/2017 8:59:34 AM    OUT CELL    Creating container
7/12/2017 8:59:35 AM    OUT CELL    Successfully created container
7/12/2017 8:59:37 AM    OUT STG Successfully destroyed container
7/12/2017 8:59:40 AM    OUT APP > [email protected] start /home/vcap/app
7/12/2017 8:59:40 AM    OUT APP > node index.js
7/12/2017 8:59:40 AM    OUT APP Example app listening at http://:::3001
......
......
7/12/2017 9:00:08 AM    OUT RTR myreactapp.w3ibm.mybluemix.net - [12/07/2017:09:00:08.768 +0000] "GET / HTTP/1.1" 502 0 67 "https://console.w3ibm.bluemix.net/dashboard/apps" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0" 169.53.228.149:13440 x_forwarded_for:"9.84.35.70" x_forwarded_proto:"https" vcap_request_id:30f4de63-8ac9-4502-6d43-eb1eec7e1e02 response_time:0.003236115 app_id:4c4861e7-7ad1-4d1d-a838-b64d0e47408d x_global_transaction_id:"2500071025"
1

There are 1 best solutions below

3
On

OUT APP Example app listening at http://:::3001

Check that your app is listening on the correct host and port. It should be 0.0.0.0 and the port assigned by Cloud Foundry through the PORT environment variable (probably 8080).

The deprecated VCAP_APP_HOST and VCAP_APP_PORT environment variables are not set by Diego.