openshift/ansible-service-broker

The service broker returned an invalid response for the request to https://broker.automation-broker.svc:1338/ansible-service-broker//v2/catalog

cmoulliard opened this issue · 2 comments

Issue

When I try to register the OAB with cd client where auth is enabled, I get this error

cf create-service-broker oab admin admin https://broker.automation-broker.svc:1338/ansible-service-
...

Creating service broker oab as admin...
REQUEST: [2020-04-02T19:32:19+02:00]
POST /v2/service_brokers HTTP/1.1
Host: api.95.217.161.67.nip.io
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: cf/6.50.0+4f0c3a2ce.2020-03-03 (go1.13.4; amd64 linux)
{
  "auth_password": "[PRIVATE DATA HIDDEN]",
  "auth_username": "admin",
  "broker_url": "https://broker.automation-broker.svc:1338/ansible-service-broker/",
  "name": "oab"
}


RESPONSE: [2020-04-02T19:32:19+02:00]
HTTP/1.1 502 Bad Gateway
Content-Length: 422
Content-Type: application/json;charset=utf-8
Date: Thu, 02 Apr 2020 17:32:19 GMT
Server: istio-envoy
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 59
X-Vcap-Request-Id: c66e9c44-fdb0-49b2-b434-363d054fc92c::07a219c1-469e-4241-8025-c24869eafaa4
{
  "code": 10001,
  "description": "The service broker returned an invalid response for the request to https://broker.automation-broker.svc:1338/ansible-service-broker//v2/catalog. Status Code: 301 Moved Permanently, Body: ",
  "error_code": "CF-ServiceBrokerBadResponse",
  "http": {
    "method": "GET",
    "status": 301,
    "uri": "https://broker.automation-broker.svc:1338/ansible-service-broker//v2/catalog"
  }
}


The service broker returned an invalid response for the request to https://broker.automation-broker.svc:1338/ansible-service-broker//v2/catalog. Status Code: 301 Moved Permanently, Body:
FAILED

The log of the broker mentions that apparently user was found

[2020-04-03T06:50:09.799Z] [NOTICE] - Broker successfully bootstrapped
[2020-04-03T06:51:55.088Z] [DEBUG] - user found, returning true
[2020-04-03T06:51:55.088Z] [DEBUG] - We found one. HOORAY!
10.244.0.1 - - [03/Apr/2020:06:51:55 +0000] "GET /ansible-service-broker//v2/catalog HTTP/1.1" 301 0

There is no issue. The URL used by cf client to register included a non needed / at the end of the RUL
That works using cf create-service-broker oab admin admin https://broker.automation-broker.svc:1338/ansible-service-broker.