cloudfoundry-community-attic / cf-services-release

Cloud Foundry services release (includes mysql V1 service and gateway only)
Apache License 2.0
9 stars 25 forks source link

PostgreSQL Gateway: Bad location header #20

Closed KristianOellegaard closed 11 years ago

KristianOellegaard commented 11 years ago

This is the job configuration I used:

- name: postgresql_service
  template:
  - postgresql_node
  - postgresql_gateway
  instances: 1
  resource_pool: common
  release: cf-services
  networks:
  - name: default
    default: [dns, gateway]
  properties:
    cc_api_version: v2
    uaa_client_id: cf
    uaa_endpoint: http://uaa.us-tx-1.mycloud.com/
    uaa_client_auth_credentials:
      username: admin
      password: adminpassword
    postgresql_node:
      plan: basic

In postgresql_gateway.log I get:

[2013-07-25 09:17:09.785656] postgresql_gateway - pid=3428 tid=b8e0 fid=e0f5   INFO -- AuaaS-Provisioner: Initializing
[2013-07-25 09:17:09.789567] postgresql_gateway - pid=3428 tid=b8e0 fid=e0f5  DEBUG -- Connecting with NATS
[2013-07-25 09:17:10.165826] postgresql_gateway - pid=3428 tid=b8e0 fid=e0f5  FATAL -- bad location header /var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/cf-uaa-lib-1.3.10/lib/uaa/token_issuer.rb:142:in `implicit_grant_with_creds'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/vcap_services_base-0.1.17/lib/base/catalog_manager_v2.rb:56:in `refresh_client_auth_token'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/vcap_services_base-0.1.17/lib/base/catalog_manager_v2.rb:40:in `initialize'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/vcap_services_base-0.1.17/lib/base/asynchronous_service_gateway.rb:45:in `new'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/vcap_services_base-0.1.17/lib/base/asynchronous_service_gateway.rb:45:in `setup'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/vcap_services_base-0.1.17/lib/base/base_async_gateway.rb:40:in `initialize'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/vcap_services_base-0.1.17/lib/base/asynchronous_service_gateway.rb:16:in `initialize'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/sinatra-1.2.9/lib/sinatra/base.rb:1293:in `new'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/sinatra-1.2.9/lib/sinatra/base.rb:1293:in `build'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/sinatra-1.2.9/lib/sinatra/base.rb:1280:in `new'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/vcap_services_base-0.1.17/lib/base/gateway.rb:121:in `block in start'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `call'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
/var/vcap/packages/postgresql_gateway/postgresql_service/vendor/bundle/ruby/1.9.1/gems/vcap_services_base-0.1.17/lib/base/gateway.rb:98:in `start'
/var/vcap/packages/postgresql_gateway/postgresql_service/bin/postgresql_gateway:31:in `<main>'
[2013-07-25 09:17:10.169999] postgresql_gateway - pid=3428 tid=b8e0 fid=e0f5  ERROR -- Exiting due to NATS error: Could not connect to server on nats://nats:c1oudc0wc1oudc0w@10.0.2.11:4222
[2013-07-25 09:17:10.170590] postgresql_gateway - pid=3428 tid=b8e0 fid=e0f5   INFO -- AuaaS-Provisioner: Shutting down

I see a similar issue here cloudfoundry/cf-release#92 - but I already have all the UAA properties afaik.

If it have any interest, here is my uaa/clients/cf:

cf:
        id: cf
        override: true
        authorized-grant-types: password,implicit,refresh_token
        authorities: uaa.none
        scope: cloud_controller.read,cloud_controller.write,openid,password.write,cloud_controller.admin,scim.read,scim.write
        access-token-validity: 7200
        refresh-token-validity: 1209600

Does anyone have an idea what the real problem is here?

shalako commented 11 years ago

As posted on vcap-dev@googlegroups, David Stevenson suggests:

You may have the wrong endpoint for UAA. You have to tell the service GW where CC and UAA are. These are the relevant properties for describing how to access UAA & CC in my manifest:

properties: uaa_client_id: "cf"
uaa_endpoint: http://uaa.stevenson.cf-app.com uaa_client_auth_credentials: username: admin password: password-for-an-admin-user cc: srv_api_uri: http://ccng.stevenson.cf-app.com

You might also try "HTTPS" URLs if the HTTP ones don't work.

shalako commented 11 years ago

We've moved the postgresql service to the contrib repo. https://github.com/cloudfoundry/cf-services-contrib-release