Azure / open-service-broker-azure

The Open Service Broker API Server for Azure Services
https://osba.sh
MIT License
248 stars 100 forks source link

Empty Services List for CF OSBA app #543

Open sachitaggarwal opened 6 years ago

sachitaggarwal commented 6 years ago

Steps to reproduce

  1. Deploy OSBA application to CF from master branch
  2. Application gets deployed successfully and starts
  3. Access application - http://[app-host]/v2/catalog => this returns empty list

Is this expected ?

I tried debugging application code and i feel catalog response field is never initialized in server.go ; hence we always get empty list

Can you please help here , do i need to perform some more additional steps to start getting available Azure services via service broker ?

zhongyi-zhang commented 6 years ago

@sachitaggarwal curl -u <username>:<password> http://<osba-url>/v2/catalog --header "X-Broker-API-Version: 2.13" works for me. No additional steps. Just curious, why don't you use CF CLI to manage OSBA via cf create-service-broker …?

sachitaggarwal commented 6 years ago

@zhongyi-zhang Thanks for clarification yes with above header API works fine from postman. I was trying with chrome where i see empty list.

I was trying to manually call API to check content of catalog because of following error - "Service broker catalog is invalid: Service ids must be unique, Service name must be unique"

No other service brokers are installed in cf cf version 6.33.0+a345ea34d.2017-11-20 cf api version - 2.115.0

krancour commented 6 years ago

Is your CF multi-tenant, by chance?

norshtein commented 6 years ago

Hi @sachitaggarwal , as the open service broker api spec said:

Requests from the Platform to the Service Broker MUST contain a header that declares the version number of the Open Service Broker API that the Platform is using:

X-Broker-API-Version: 2.14

The version numbers are in the format MAJOR.MINOR using semantic versioning.

So you can't requesting broker URL using chrome since chrome won't add this header for you.

sachitaggarwal commented 6 years ago

@krancour yes my CF is multi-tenant , and i used space-scoped flag while creating broker

zhongyi-zhang commented 6 years ago

@sachitaggarwal ah, that's why

I was trying to manually call API to check content of catalog because of following error - "Service broker catalog is invalid: Service ids must be unique, Service name must be unique"

Service names, IDs, and plan IDs should globally unique in CF. Multi-tenant is not supported unless a service broker implement something to generate space-scoped service names, IDs, and plan IDs. FYI: https://github.com/Azure/open-service-broker-azure/issues/477

I don't know why CF's Cloud Controller doesn't handle this itself as it provides spaces and space-scoped.