Re: I keep on getting 502 Bad Gateway: Registered endpoint failed to handle the request.


Ronak Banka
 

Hi Ushani,

From logs what I can see is that application is trying to access "/carbon"
route instead of "/", which is https://is530.local.pcfdev.io/carbon

how are the application routes configured? you can configure the path
during cf push

Thanks
Ronak


On Wed, Sep 13, 2017 at 4:31 PM, Lucas Reginato <lucas.reginato(a)gmail.com>
wrote:

Hi Ushani,

I have the same experience, and this is what I found:

1) If your application uses HTTP, everything works just fine.
You will access the HTTPS endpoint (provided by the Load Balancer) and you
can access your app.

2) If your application uses HTTPS, you will receive a 502 (Bad Gateway)
when you try to access it.
This happens because the GoRouter only talks HTTP to the application.
I mean, PCF Dev will provide you a HTTPS endpoint, but that is the HTTPS
Load Balancer endpoint.
The Load Balancer will send the HTTPS request to the GoRouter layer, and
GoRouter will only talk HTTP to the application.
So, if the application talks HTTPS, nahhhh, bad communication, and the
request fails with a 502.

I was able to enable HTTPS in my application by creating a TCP route to my
application.

I hope that helps.
And I would like to listen what others engineers done to fix this.

Thanks,

-Lucas Reginato

On Wed, Sep 13, 2017 at 11:58 AM, Ushani Balasooriya <ushanib(a)gmail.com>
wrote:

I started to access http and https bpth. But it gives me the below error
when I browse the app.
I have installed PCF dev in my local machine.
This is my route: Routeshttps://is530.local.pcfdev.io


2017-09-13T15:21:45.139+05:30 [RTR/0] [OUT] is530.local.pcfdev.io -
[2017-09-13T09:51:45.137+0000] "GET /carbon HTTP/1.1" 502 0 67 "-"
"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101
Firefox/51.0" "192.168.11.1:60550" "10.0.2.15:60055" x_forwarded_for:"-"
x_forwarded_proto:"https" vcap_request_id:"66256b25-32b9-4769-72f0-add0592e0b59"
response_time:0.002344385 app_id:"faf5b9d6-a48f-499e-a5f8-35286c921714"
app_index:"0"
2017-09-13T15:22:15.846+05:30 [RTR/0] [OUT] is530.local.pcfdev.io -
[2017-09-13T09:52:15.845+0000] "GET /carbon HTTP/1.1" 502 0 67 "-"
"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101
Firefox/51.0" "192.168.11.1:60550" "10.0.2.15:60055" x_forwarded_for:"-"
x_forwarded_proto:"https" vcap_request_id:"524a30a6-8cb4-44cc-7937-96a7fcae20f5"
response_time:0.000872472 app_id:"faf5b9d6-a48f-499e-a5f8-35286c921714"
app_index:"0"
2017-09-13T15:22:19.309+05:30 [RTR/0] [OUT] is530.local.pcfdev.io -
[2017-09-13T09:52:19.308+0000] "GET /carbon HTTP/1.1" 502 0 67 "-"
"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101
Firefox/51.0" "192.168.11.1:41342" "10.0.2.15:60055" x_forwarded_for:"-"
x_forwarded_proto:"http" vcap_request_id:"c32925f5-d994-4e42-606a-86b5f52159f4"
response_time:0.000675021 app_id:"faf5b9d6-a48f-499e-a5f8-35286c921714"
app_index:"0"
2017-09-13T15:22:25.925+05:30 [RTR/0] [OUT] is530.local.pcfdev.io -
[2017-09-13T09:52:25.924+0000] "GET /carbon HTTP/1.1" 502 0 67 "-"
"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101
Firefox/51.0" "192.168.11.1:41342" "10.0.2.15:60055" x_forwarded_for:"-"
x_forwarded_proto:"http" vcap_request_id:"183c95fe-2619-4ecb-7739-585f7763d9f1"
response_time:0.000756516 app_id:"faf5b9d6-a48f-499e-a5f8-35286c921714"
app_index:"0"


--
Lucas Reginato

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.