cloudfoundry-community/cf-services-contrib — pull request #1 by rkoster (2013-06-04 12:45:06+00:00)
Title: Fix cloud_controller_ng => memcached_gateway imcompatibilities

We are trying to deploy the memcached ng gateway into a current cf-release. The deployment went fine and the gateway is picked up by the cloud controller.
`cf info --services`:
```
Getting services... OK
service version provider plans description
memcached 1.4 core 100 Memcached in-memory cache
```

However when running `cf create-service` we get an `CFoundry::ServerError: 10001: Server error`.

On the memcached gateway running `tail -f /var/vcap/sys/log/memcached_gateway/*.log` provides us with the following stacktrace:

```
JsonMessage::ValidationError - Field: unique_id, Error: Unknown field: unique_id:
/var/vcap/packages/memcached_gateway/services/ng/memcached/vendor/bundle/ruby/1.9.1/gems/vcap_common-2.0.10/lib/json_message.rb:171:in `set_field'
/var/vcap/packages/memcached_gateway/services/ng/memcached/vendor/bundle/ruby/1.9.1/gems/vcap_common-2.0.10/lib/json_message.rb:135:in `block in initialize'
/var/vcap/packages/memcached_gateway/services/ng/memcached/vendor/bundle/ruby/1.9.1/gems/vcap_common-2.0.10/lib/json_message.rb:135:in `each'
/var/vcap/packages/memcached_gateway/services/ng/memcached/vendor/bundle/ruby/1.9.1/gems/vcap_common-2.0.10/lib/json_message.rb:135:in `initialize'
/var/vcap/packages/memcached_gateway/services/ng/memcached/vendor/bundle/ruby/1.9.1/gems/vcap_common-2.0.10/lib/json_message.rb:104:in `new'
/var/vcap/packages/memcached_gateway/services/ng/memcached/vendor/bundle/ruby/1.9.1/gems/vcap_common-2.0.10/lib/json_message.rb:104:in `from_decoded_json'
/var/vcap/packages/memcached_gateway/services/ng/memcached/vendor/bundle/ruby/1.9.1/gems/vcap_common-2.0.10/lib/json_message.rb:74:in `decode'
/var/vcap/packages/memcached_gateway/services/ng/memcached/vendor/bundle/ruby/1.9.1/gems/vcap_services_base-0.1.17/lib/base/asynchronous_service_gateway.rb:157:in `block in '
```

It seems there is an incompatibility between the memcached gateway and the cloud_controller_ng. The cloud_controller sends an unique_id where the gateway does not yet expect it. Which can be traced back to [this line](https://github.com/cloudfoundry/vcap-common/blob/master/lib/services/api/messages.rb#L95).