Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

standing up the v2 mysql service broker

304 views
Skip to first unread message

Troy Astle

unread,
Oct 3, 2013, 11:39:58 AM10/3/13
to vcap...@cloudfoundry.org
Hi All, 

I have spent today trying to wrap my head around Service Brokers for CFv2.

I've initially started by trying to deploy the mysql service from this repository:
https://github.com/cloudfoundry/cf-services-release 
After the standard yml tweaking I have deployed the node and broker.

Following this I try to add the service to installation:
tastle@reading-cloud-hammer G=master tastle-dev $ cf add-service-broker
Name> ta-mysql-3
URL> http://9.10.5.124:47849
Token> c1oudc0wc1oudc0w
... FAILED
CFoundry::APIError: 270007: Authentication failed for the service broker API. Double-check that the token is correct: http://9.10.5.124:47849/v2/catalog
cat ~/.cf/crash # for more details

 
The error in the log on the broker is as follows:
{"timestamp":1380811570.5951648,"message":"Validation failure: {\"status\"=>401, \"msg\"=>{\"code\"=>30100, \"description\"=>\"Not authorized\", \"error\"=>{\"backtrace\"=>nil, \"types\"=>[\"VCAP::Services::Base::Error::ServiceError\", \"StandardError\", \"Exception\"]}}}, expected token: c1oudc0wc1oudc0w, specified token: ","log_level":"error","source":"mysql_gateway","data":{"request_guid":"937f1955-3cd5-4cab-bb64-81a1f0bfc151"},"thread_id":7328180,"fiber_id":22106820,"process_id":4847,"file":"/var/vcap/packages/mysql_gateway/mysql_service/vendor/bundle/ruby/1.9.1/gems/vcap_services_base-0.2.0/lib/base/asynchronous_service_gateway.rb","lineno":121,"method":"validate_incoming_request"}

The part that catches my eye is:
expected token: c1oudc0wc1oudc0w, specified token: 
This indicates to me that the token is not being passed through correctly.

I'm not certain where I should head next with my debugging, of if I should be trying an alternate broker
Has anyone else seen this error with the mysql broker?

Dr Nic Williams

unread,
Oct 3, 2013, 1:08:18 PM10/3/13
to vcap...@cloudfoundry.org
I'm not sure if cf-service-release has support for the new broker yet? https://github.com/cloudfoundry/cf-services-release/commits/master doesn't seem to mention it. Its also not mentioned in the .gitmodules https://github.com/cloudfoundry/cf-services-release/blob/master/.gitmodules

Perhaps they implement it in a branch first; or at least keep the v1 gateway in the HEAD of the repo until the v2 broker is good to go.



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



--
Dr Nic Williams
Stark & Wayne LLC - consultancy for Cloud Foundry users
twitter @drnic

Jesse Zhang

unread,
Oct 3, 2013, 1:17:45 PM10/3/13
to vcap...@cloudfoundry.org
Hi Troy,
  Could you kindly point to us the documentation you're following?
  If I understand correctly you are trying to deploy the RDS-MySQL gateway (or broker as they are now called). You won't need to invoke
cf add-service-broker
but instead you should do
cf add-service-auth-token
there you can specify the shared secret between the Cloud Controller and the MySQL service gateway.

Jesse and Mark
Team Cloud Foundry

Troy Astle

unread,
Oct 3, 2013, 4:57:21 PM10/3/13
to vcap...@cloudfoundry.org
@DrNic
I started looking at the repo https://github.com/cloudfoundry/cf-services-release because the docs say it is built for V2.
However I could certainly be using it in error.

@Jesse and Mark

However after running the bosh deploy of the manifest containing the service broker and node I got lost.

Line 168 reads:
The service gateway and initial service node are now running and will appear to your Cloud Foundry users (BUT, please ahead, do not stop yet!).

However this was not the case for me, I could see the VMs in Bosh but no service in Cloud Foundry.
Hence I tried to call add-service-broker as described in the registration guide:
https://docs.google.com/document/d/1IE-xPvs14oLEIAt29YTxK9-Wn-tCe4iEmXr5j_5Uo5E/edit 

I originally set out to use this service as an example broker for a new V2 service broker. 
I'm more interested in finding a working example than getting mysql working.
Are you guys aware of an alternate example to follow? 

Cheers,
Troy.

Dr Nic Williams

unread,
Oct 3, 2013, 5:10:38 PM10/3/13
to vcap...@cloudfoundry.org
"the docs say it is built for V2" - can you link me to those docs. Perhaps they are wrong; perhaps I'm wrong; or perhaps (and this is my guess) they are referring to CF v2; rather than CF Gateway/Broker API v2, which is what the cf-mysql-broker is being written towards.

Try following the services docs http://docs.cloudfoundry.com/docs/running/deploying-cf/adding-services.html (which are specifically for the contrib repo; but should work for mysql service in cf-services-release) for how to deploy the CF Services API v1 services.

Nic

Troy Astle

unread,
Oct 3, 2013, 5:28:16 PM10/3/13
to vcap...@cloudfoundry.org
@DrNic,
Thanks for the snappy reply :-)

I think you're correct. It says "works with cloud foundry V2" which I incorrectly interpreted as the Broker API V2.

I'll take a look at the contrib repo tomorrow. Sounds like it's best to stick with Broker API V1 services for now? Broker API V2 is in flux.

Troy.

Dr Nic Williams

unread,
Oct 3, 2013, 8:10:36 PM10/3/13
to vcap...@cloudfoundry.org, vcap...@cloudfoundry.org
That sounds right.

I'm not sure of Services teams plan for bosh-ifying the new broker.


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

Cornelia Davis

unread,
Oct 4, 2013, 9:32:59 AM10/4/13
to vcap...@cloudfoundry.org
I think you've got in now Troy, but for clarification for anyone else reading this thread:

We are on CF RUNTIME V2 - that's what is deployed to run.pivotal.io, what is deployed in any cf-release pull you get, etc.  When it comes to services, the versions we refer to are INDEPENDENT of the CF runtime version.  There, the currently complete API remains V1 and is accurately described here: http://docs.cloudfoundry.com/docs/running/architecture/services/writing-service.html.  Just last week, David and Shannon sent out this message https://groups.google.com/a/cloudfoundry.org/forum/?fromgroups#!topic/vcap-dev/BshT-IXYTHw which give an early view of the SERVICE BROKER v2 api.

Troy, you are right that currently you should be building to the V1 Service Broker (Gateway) API and this repo https://github.com/cloudfoundry/cf-services-release contains the mysql V1 Service Broker (Gateway). And the services in https://github.com/cloudfoundry/cf-services-contrib-release are all v1 services.

The services team is planning on bosh-ifying the new broker - stay tuned.

And finally, there is another example that I've worked with others on - described here http://pivotallabs.com/creating-a-service-gateway-in-cloud-foundry/.

Cornelia

Shannon Coen

unread,
Oct 4, 2013, 1:43:22 PM10/4/13
to vcap...@cloudfoundry.org
Reply all
Reply to author
Forward
0 new messages