Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1501512 - Broker does not return credentials on subsequent bind endpoint calls
Broker does not return credentials on subsequent bind endpoint calls
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker (Show other bugs)
3.7.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.7.0
Assigned To: Shawn Hurley
Weihua Meng
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-12 13:02 EDT by Shawn Hurley
Modified: 2018-04-05 05:30 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Broker overwrote the bind credentials on subsequent bind endpoint calls Consequence: Bind credentials were saved incorrectly Fix: save bind credentials for every call Result: works as expected
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-05 05:29:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0636 None None None 2018-04-05 05:30 EDT

  None (edit)
Description Shawn Hurley 2017-10-12 13:02:44 EDT
Description of problem:
The broker is receiving more than 1 bind call for a service that is a duplicate and not returning the credentials

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Call bind on the API end point for a service. this will return a 201 with the credentials in the json body
2. Call the same bind. This will return with a 200 with an empty json body.
3.

Actual results:
Empty Json Body

Expected results:
The already created credentials should also be in the body.

Additional info:
Comment 1 Shawn Hurley 2017-10-12 16:24:32 EDT
Bug fixes with PR: https://github.com/openshift/ansible-service-broker/pull/486
Comment 3 Weihua Meng 2017-10-18 07:33:23 EDT
Hi Shawn
Could you provide detailed commands for reproduce steps?
Thanks so much.
Comment 4 Shawn Hurley 2017-10-18 10:42:17 EDT
Hello,

You will want to call: 

curl -XPUT -H "Authorization: Bearer $(oc whoami -t)" -H 'Content-Type: application/json' <broker_url>/ansible-service-broker/v2/service_instances/<service_instance of bindable app>/service_bindings/924015ad-2358-4a5c-8770-80c5d22ad118 -d '{"service_id":"<id of service>","plan_id":"<cluster service plan id that was used to provison service.","bind_resource":{"app_guid":"54651936-b408-11e7-8470-c85b76064d75"}}' 

You should call that twice once you provision the bindable APB.
Both calls should have the credentials.
Comment 5 weiwei jiang 2017-10-19 05:21:19 EDT
Checked with ansible-service-broker-1.0.10-1.el7.x86_64, and found that 

# curl -sk -XPUT -H "Content-Type: application/json" -H Authorization:\ Bearer\ wcLa0qpVlpXfCVVmENPoPcleNvglerN9ogZmGzhOynw https://asb.ansible-service-broker.svc:1338/ansible-service-broker/v2/service_instances/03572d01-e7d5-4b30-8f35-179eda3aec0c/service_bindings/03572d01-e7d5-4b30-8f35-179eda3aec0c -d '{"service_id":"27793015fe45db2fbc1deb7372cc4036","plan_id":"9f90a44d8181941768273a684de50de5","bind_resource":{}}' -v
* About to connect() to asb.ansible-service-broker.svc port 1338 (#0)
*   Trying 172.30.187.252...
* Connected to asb.ansible-service-broker.svc (172.30.187.252) port 1338 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
* 	subject: CN=asb.ansible-service-broker.svc
* 	start date: Oct 19 08:31:09 2017 GMT
* 	expire date: Oct 19 08:31:10 2019 GMT
* 	common name: asb.ansible-service-broker.svc
* 	issuer: CN=openshift-service-serving-signer@1508367498
> PUT /ansible-service-broker/v2/service_instances/03572d01-e7d5-4b30-8f35-179eda3aec0c/service_bindings/03572d01-e7d5-4b30-8f35-179eda3aec0c HTTP/1.1
> User-Agent: curl/7.29.0
> Host: asb.ansible-service-broker.svc:1338
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer wcLa0qpVlpXfCVVmENPoPcleNvglerN9ogZmGzhOynw
> Content-Length: 113
> 
* upload completely sent off: 113 out of 113 bytes
< HTTP/1.1 201 Created
< Content-Type: application/json
< Date: Thu, 19 Oct 2017 09:20:37 GMT
< Content-Length: 182
< 
{
  "credentials": {
    "DB_HOST": "postgresql",
    "DB_NAME": "admin",
    "DB_PASSWORD": "redhat",
    "DB_PORT": "5432",
    "DB_TYPE": "postgres",
    "DB_USER": "admin"
  }
}
* Connection #0 to host asb.ansible-service-broker.svc left intact
Comment 6 weiwei jiang 2017-10-19 05:30:29 EDT
Checked with ansible-service-broker-1.0.10-1.el7.x86_64, and found asb will return the same result with the following op for multiple times.

# curl -sk -XPUT -H "Content-Type: application/json" -H Authorization:\ Bearer\ wcLa0qpVlpXfCVVmENPoPcleNvglerN9ogZmGzhOynw https://asb.ansible-service-broker.svc:1338/ansible-service-broker/v2/service_instances/03572d01-e7d5-4b30-8f35-179eda3aec0c/service_bindings/03572d01-e7d5-4b30-8f35-179eda3aec0c -d '{"service_id":"27793015fe45db2fbc1deb7372cc4036","plan_id":"9f90a44d8181941768273a684de50de5","bind_resource":{}}' -v
* About to connect() to asb.ansible-service-broker.svc port 1338 (#0)
*   Trying 172.30.187.252...
* Connected to asb.ansible-service-broker.svc (172.30.187.252) port 1338 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
* 	subject: CN=asb.ansible-service-broker.svc
* 	start date: Oct 19 08:31:09 2017 GMT
* 	expire date: Oct 19 08:31:10 2019 GMT
* 	common name: asb.ansible-service-broker.svc
* 	issuer: CN=openshift-service-serving-signer@1508367498
> PUT /ansible-service-broker/v2/service_instances/03572d01-e7d5-4b30-8f35-179eda3aec0c/service_bindings/03572d01-e7d5-4b30-8f35-179eda3aec0c HTTP/1.1
> User-Agent: curl/7.29.0
> Host: asb.ansible-service-broker.svc:1338
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer wcLa0qpVlpXfCVVmENPoPcleNvglerN9ogZmGzhOynw
> Content-Length: 113
> 
* upload completely sent off: 113 out of 113 bytes
< HTTP/1.1 201 Created
< Content-Type: application/json
< Date: Thu, 19 Oct 2017 09:20:37 GMT
< Content-Length: 182
< 
{
  "credentials": {
    "DB_HOST": "postgresql",
    "DB_NAME": "admin",
    "DB_PASSWORD": "redhat",
    "DB_PORT": "5432",
    "DB_TYPE": "postgres",
    "DB_USER": "admin"
  }
}
* Connection #0 to host asb.ansible-service-broker.svc left intact
Comment 7 Weihua Meng 2017-10-27 04:16:28 EDT
Hi, Shawn
Can you help?
Thanks.
Comment 8 Shawn Hurley 2017-10-27 09:58:32 EDT
> Checked with ansible-service-broker-1.0.10-1.el7.x86_64, and found asb will return the same result with the following op for multiple times.

That appears to verify the bug was fixed.
Comment 9 Weihua Meng 2017-10-27 10:26:04 EDT
Thanks.
According to above comments, it is fixed.
Comment 13 errata-xmlrpc 2018-04-05 05:29:37 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0636

Note You need to log in before you can comment on or make changes to this bug.