cloudfoundry / service-fabrik-broker

Cloud Foundry service broker which provisions service instances as Docker containers and BOSH deployments.
Apache License 2.0
41 stars 50 forks source link

service instance custom error message in status template is not returned #1493

Open gberche-orange opened 2 years ago

gberche-orange commented 2 years ago

Describe the bug Thanks for the great work. Testing how to return a custom failed error message, I never see it being returned in SFServiceInstance (and hence nor by the service broker)

To Reproduce Steps to reproduce the behavior:

Given a SFPlan with the following status template

  templates:
  - action: status
    content: |-
      # Status template for provision call
      provision:
        state: failed
        description: a custom error message

When the SFServiceInstance gets provisionned, then its status does not contain the description or error field

status:
  appliedSpec:
    planId: ""
    serviceId: ""
  resources:
  - apiVersion: v1
    kind: ConfigMap
    name: instance-sapcp-5a29d700-3c08-4d5e-a68a-3e6cae710ab4
    namespace: sf-5a29d700-3c08-4d5e-a68a-3e6cae710ab4
  state: failed

However, when the status template is missing, then a proper error message is returned

 status:                                                                                                                                                                                                  │
│   appliedSpec:                                                                                                                                                                                           │
│     planId: ""                                                                                                                                                                                           │
│     serviceId: ""                                                                                                                                                                                        │
│   description: sources template not found for plan 24d7d4c8-6fe2-4c2a-a5ca-b826937d5a88                                                                                                                  │
│   error: |-                                                                                                                                                                                              │
│     Retry threshold reached for 930f66eb-3311-4aa2-8037-16ad164b1384.                                                                                                                                    │
│     sources template not found for plan 24d7d4c8-6fe2-4c2a-a5ca-b826937d5a88                                                                                                                             │
│   state: failed                                                                                                                                                                                          │

The provisionner logs include the following trace provisioner-6c44c77565-8l7rt2021-12-13T17:12:39.649Z INFO provisioners.instance Updating provision status from template {"instanceID": "5a29d700-3c08-4d5e-a68a-3e6cae710ab4", "state": "in progress", "lastOperation": "in_queue", "newState": "failed"}

Expected behavior

The SFServiceInstance and service broker should return the description to the osb client, as documented in the OSB specs at https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#body-1

Additional context

Reproduced with helm chart version: 0.19.0

Possibly related to https://github.com/cloudfoundry-incubator/service-fabrik-broker/issues/1305

cf-gitbot commented 2 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/180622783

The labels on this github issue will be updated when the story is started.

anoopjb commented 2 years ago

Unfortunately we cannot tackle this soon. Also we are open for contributions. 👍