502 Bad Gateway - Error when trying to make the service public

1,058 views
Skip to first unread message

Ramesh Sambandan

unread,
Jul 30, 2014, 7:35:56 PM7/30/14
to vcap...@cloudfoundry.org
I am getting following error when trying to make the service public. My service broker endpoint is implemented in Tomcat, it is not hitting the tomcat server when I execute the command.

What am I missing? can somebody help.
****************************

H:\Tomcat\nonWindows\apache-tomcat-8.0.9>cf curl /v2/service_plans/c62e66da-e793-409d-920b-038afcd74914
{
   "metadata": {
      "guid": "c62e66da-e793-409d-920b-038afcd74914",
      "url": "/v2/service_plans/c62e66da-e793-409d-920b-038afcd74914",
      "created_at": "2014-07-30T22:52:30+00:00",
      "updated_at": null
   },
   "entity": {
      "name": "normal",
      "free": true,
      "description": "Normal MS SQL Server Database Connection",
      "service_guid": "1d4b8b8f-5819-4e3d-a5e0-444e9c844073",
      "extra": null,
      "unique_id": "normalPlanId",
      "public": false,
      "active": true,
      "service_url": "/v2/services/1d4b8b8f-5819-4e3d-a5e0-444e9c844073",
      "service_instances_url": "/v2/service_plans/c62e66da-e793-409d-920b-038afcd74914/service_instances"
   }
}

H:\Tomcat\nonWindows\apache-tomcat-8.0.9>cf curl /v2/service_plans/c62e66da-e793-409d-920b-038afcd74914 -X 'PUT' -d '{"public":true}'
502 Bad Gateway: Registered endpoint failed to handle the request.
H:\Tomcat\nonWindows\apache-tomcat-8.0.9>set CF_TRACE=true
H:\Tomcat\nonWindows\apache-tomcat-8.0.9>cf curl /v2/service_plans/c62e66da-e793-409d-920b-038afcd74914 -X 'PUT' -d '{"public":true}'

VERSION:
6.3.0-053b818


REQUEST: [2014-07-30T17:18:32-06:00]
'PUT' /v2/service_plans/c62e66da-e793-409d-920b-038afcd74914 HTTP/1.1
Host: api.10.244.0.34.xip.io
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: go-cli 6.3.0-053b818 / windows

'{public:true}'

RESPONSE: [2014-07-30T17:18:32-06:00]
HTTP/1.1 502 Bad Gateway
Connection: close
Content-Length: 67
Content-Type: text/plain; charset=utf-8
Date: Wed, 30 Jul 2014 23:18:24 GMT
X-Cf-Routererror: endpoint_failure

502 Bad Gateway: Registered endpoint failed to handle the request.

502 Bad Gateway: Registered endpoint failed to handle the request.
************************************

thanks
-Ramesh

Ramesh Sambandan

unread,
Jul 31, 2014, 1:09:52 AM7/31/14
to vcap...@cloudfoundry.org
The issue I believe is the cf removes the quote from json.

I also tried with 6.3.2 & 6.3.0
my cf release version is 176.

Additional questions:
1. How can I get earlier versions of cf
2. Is there a way to make the service broker public when creating.
3. Is there  way to make the service public from warden.

Please help.

thanks
-Ramesh


-Ramesh

--
You received this message because you are subscribed to the Google Groups "Cloud Foundry Developers" group.
To view this discussion on the web visit https://groups.google.com/a/cloudfoundry.org/d/msgid/vcap-dev/cacf8657-a6a3-4d25-9ebe-d7d7dd3ffec5%40cloudfoundry.org.

To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.

James Bayer

unread,
Jul 31, 2014, 2:28:10 AM7/31/14
to vcap...@cloudfoundry.org
1. How can I get earlier versions of cf
2. Is there a way to make the service broker public when creating.
yes, you can use the "cf curl" command before the new cf ones are ready

3. Is there  way to make the service public from warden.
i don't follow you. are you saying poke a hole in the app security group?


To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.



--
Thank you,

James Bayer

Ramesh Sambandan

unread,
Jul 31, 2014, 10:06:36 AM7/31/14
to vcap...@cloudfoundry.org
3. Is there  way to make the service public from warden.
i don't follow you. are you saying poke a hole in the app security group?

-I meant a way to avoid cf.  My assumption at this point is that there is http server running in CF and CF is just mediator sending curl command to it. I suspect cf command removes the double quotes around public which is causing the problem. So my theory is we know where the http server is running, we can bosh ssh to right container and issue curl command directly(thus avoiding cf) to http end point(need to know the correct http end point)

I don't know how it works internally (but really really want to learn), so I could be way off mark here.

Let me know

thanks
-Ramesh





Ramesh Sambandan

unread,
Jul 31, 2014, 3:34:45 PM7/31/14
to vcap...@cloudfoundry.org

Finally, I figured a way to do it. I uploaded the cf to vagrant box and executed cf curl from there and it worked.

So the issue is specific to windows version of cf.

Can somebody point me to place where I can know more about the vms running bosh
(bosh vms)

Which vm hosts the components in "A Tour of Each Component" (http://docs.cloudfoundry.org/concepts/architecture/)

Thanks all

-Ramesh

Greg Oehmen

unread,
Jul 31, 2014, 5:04:37 PM7/31/14
to vcap-dev
Hi Ramesh:

It depends on whether you've deployed individual components (as jobs) to VMs.  I've colocated all jobs on 1 VM.  But you can map jobs (cf components) to VMs with `bosh vms` and get details with the options available.

○ → bosh vms -h
bosh vms --Usage: bosh [options]
        --details                    Return detailed VM information
        --dns                        Return VM DNS A records
        --vitals                     Return VM vitals information



○ → bosh vms
Deployment `bosh-pm-acceptance'

Director task 266

Task 266 done

+-----------+---------+---------------+--------------+
| Job/index | State   | Resource Pool | IPs          |
+-----------+---------+---------------+--------------+
| bosh/0    | running | default       | 10.10.0.7    |
|           |         |               | 54.84.151.64 |
+-----------+---------+---------------+--------------+



○ → bosh vms --details
Deployment `bosh-pm-acceptance'

Director task 262

Task 262 done

+-----------+---------+---------------+--------------+------------+--------------------------------------+--------------+
| Job/index | State   | Resource Pool | IPs          | CID        | Agent ID                             | Resurrection |
+-----------+---------+---------------+--------------+------------+--------------------------------------+--------------+
| bosh/0    | running | default       | 10.10.0.7    | i-d8e5e3f2 | 34rcwfsd-3c78-408a-9256-83133c3ca6ba | active       |
|           |         |               | 51.11.141.01 |            |                                      |              |
+-----------+---------+---------------+--------------+------------+--------------------------------------+--------------+

VMs total: 1

○ → bosh vms --vitals
Deployment `bosh-pm-acceptance'

Director task 264

Task 264 done

+-----------+---------+---------------+--------------+-----------------------+------+------+------+--------------+------------+------------+------------+------------+
| Job/index | State   | Resource Pool | IPs          |         Load          | CPU  | CPU  | CPU  | Memory Usage | Swap Usage | System     | Ephemeral  | Persistent |
|           |         |               |              | (avg01, avg05, avg15) | User | Sys  | Wait |              |            | Disk Usage | Disk Usage | Disk Usage |
+-----------+---------+---------------+--------------+-----------------------+------+------+------+--------------+------------+------------+------------+------------+
| bosh/0    | running | default       | 10.10.0.7    | 0.00%, 0.00%, 0.00%   | 0.2% | 0.1% | 0.2% | 35% (594.3M) | 0% (60.0K) | 91%        | 0%         | 2%         |
|           |         |               | 51.11.141.01 |                       |      |      |      |              |            |            |            |            |
+-----------+---------+---------------+--------------+-----------------------+------+------+------+--------------+------------+------------+------------+------------+

VMs total: 1





To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.



--
Greg Oehmen
Cloud Foundry Product Manager
Pivotal
Reply all
Reply to author
Forward
0 new messages