1

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 > MyReactApp@1.0.0 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"
John
  • 4,786
  • 8
  • 35
  • 44

1 Answers1

1

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.

opiethehokie
  • 1,862
  • 11
  • 14
  • As I understand the CloudFoundry supplies host and port when staging application. In the DEA I see than port assigned dinamically with different values. In our application we don't assign or use such env. variables. – Ihar Valnou Jul 12 '17 at 16:05
  • Have dad a second thought, you are absolutely right. Thanks, now all works fine. – Ihar Valnou Jul 13 '17 at 10:56
  • The way to say thank you on SO is to accept the answer ;-). – amadain Jul 13 '17 at 11:41