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

No message was passed back to service catalog when provisioning failed #324

Open carolynvs opened 6 years ago

carolynvs commented 6 years ago

I accidentally tried to provision a service that wasn't available in the requested region. But I couldn't tell that from looking at the failed ServiceInstance because OSBA didn't return any error message when the provision failed.

$ kubectl describe serviceinstance wordpress-wordpress-mysql-instance
Name:         wordpress-wordpress-mysql-instance
Namespace:    svcatt
Labels:       <none>
Annotations:  <none>
API Version:  servicecatalog.k8s.io/v1beta1
Kind:         ServiceInstance
Metadata:
  Creation Timestamp:  2018-03-06T19:40:14Z
  Finalizers:
    kubernetes-incubator/service-catalog
  Generation:  1
  Owner References:
    API Version:           templates.servicecatalog.k8s.io/experimental
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  TemplatedInstance
    Name:                  wordpress-wordpress-mysql-instance
    UID:                   306d79ad-2176-11e8-bbdc-080027d25cd9
  Resource Version:        179
  Self Link:               /apis/servicecatalog.k8s.io/v1beta1/namespaces/svcatt/serviceinstances/wordpress-wordpress-mysql-instance
  UID:                     30b2c2e9-2176-11e8-9cb1-0242ac11000b
Spec:
  Cluster Service Class External Name:  azure-mysql
  Cluster Service Class Ref:
    Name:                              997b8372-8dac-40ac-ae65-758b4a5075a5
  Cluster Service Plan External Name:  basic50
  Cluster Service Plan Ref:
    Name:       427559f1-bf2a-45d3-8844-32374a3e58aa
  External ID:  42ad6b62-6ffe-4eae-93f6-99e64fc3d18c
  Parameters:
    Firewall End IP Address:    255.255.255.255
    Firewall Start IP Address:  0.0.0.0
    Location:                   centralus
    Resource Group:             default
    Ssl Enforcement:            disabled
  Update Requests:              0
Status:
  Async Op In Progress:  false
  Conditions:
    Last Transition Time:         2018-03-06T19:40:14Z
    Message:                      Provision call failed: (no description provided)
    Reason:                       ProvisionCallFailed
    Status:                       False
    Type:                         Ready
    Last Transition Time:         2018-03-06T19:40:27Z
    Message:                      Provision call failed: (no description provided)
    Reason:                       ProvisionCallFailed
    Status:                       True
    Type:                         Failed
  Deprovision Status:             Required
  Orphan Mitigation In Progress:  false
  Reconciled Generation:          1
Events:
  Type     Reason               Age              From                                Message
  ----     ------               ----             ----                                -------
  Normal   Provisioning         9m               service-catalog-controller-manager  The instance is being provisioned asynchronously
  Warning  ProvisionCallFailed  9m (x2 over 9m)  service-catalog-controller-manager  Provision call failed: (no description provided)

$ kubectl log po/osba-open-service-broker-azure-64fd6c5db4-zhdz4 -n osba
W0306 13:48:27.625278   42578 cmd.go:359] log is DEPRECATED and will be removed in a future version. Use logs instead.
time="2018-03-06T14:51:33Z" level=info msg="Setting log level" logLevel=INFO
time="2018-03-06T14:51:33Z" level=info msg="Open Service Broker for Azure starting" commit=61f415e version=devel
time="2018-03-06T14:51:33Z" level=info msg="Sensitive instance and binding details will be encrypted" encryptionScheme=AES256
time="2018-03-06T14:51:33Z" level=info msg="API server is listening" address="http://0.0.0.0:8080"
time="2018-03-06T19:20:05Z" level=error msg="error executing job; not submitting any follow-up tasks" error="error executing provisioning step \"deployARMTemplate\" for instance \"332c5a07-8e51-47d0-8778-c347d3f05fe6\": error executing provisioning step: error deploying ARM template: error deploying \"88b8a1b9-744a-4d5a-9204-9b0e66d13591\" in resource group \"default\": error submitting ARM template: resources.DeploymentsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code=\"LocationNotAvailableForResourceType\" Message=\"The provided location 'centralus' is not available for resource type 'Microsoft.DBforMySQL/servers'. List of available regions for the resource type is 'brazilsouth,canadacentral,canadaeast,centralindia,eastasia,eastus2,eastus,japaneast,japanwest,northcentralus,northeurope,southcentralus,southeastasia,westeurope,westindia,westus'.\"" job=executeProvisioningStep taskID=02e3c157-91c5-4c83-b5a5-09dbe64bad91
time="2018-03-06T19:40:20Z" level=error msg="error executing job; not submitting any follow-up tasks" error="error executing provisioning step \"deployARMTemplate\" for instance \"42ad6b62-6ffe-4eae-93f6-99e64fc3d18c\": error executing provisioning step: error deploying ARM template: error deploying \"c9147349-9057-447b-8a9a-212b6eb1454a\" in resource group \"default\": error submitting ARM template: resources.DeploymentsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code=\"LocationNotAvailableForResourceType\" Message=\"The provided location 'centralus' is not available for resource type 'Microsoft.DBforMySQL/servers'. List of available regions for the resource type is 'brazilsouth,canadacentral,canadaeast,centralindia,eastasia,eastus2,eastus,japaneast,japanwest,northcentralus,northeurope,southcentralus,southeastasia,westeurope,westindia,westus'.\"" job=executeProvisioningStep taskID=4ced90d8-804f-4d41-97f2-68e679baafae

Would it be possible to have sent back the following message to Service Catalog?

The provided location 'centralus' is not available for resource type 'Microsoft.DBforMySQL/servers'. List of available regions for the resource type is 'brazilsouth,canadacentral,canadaeast,centralindia,eastasia,eastus2,eastus,japaneast,japanwest,northcentralus,northeurope,southcentralus,southeastasia,westeurope,westindia,westus'.

carolynvs commented 6 years ago

The same thing just happened during bind because I messed up the firewall rules and again, it would be really nice to see the errors make their way back into service catalog! 😀

Error 9000: Client with IP address '24.15.200.84' is not allowed to connect to this MySQL server.