googlearchive / k8s-service-catalog

[DEPRECATED] Commandline tool to manage Service Catalog lifecycle and GCP Service Broker atop Kubernetes Cluster
Apache License 2.0
69 stars 31 forks source link

Bad request trying to create Cloud SQL instance #201

Closed prydonius closed 6 years ago

prydonius commented 6 years ago

I'm trying to test the GCP Service Broker with Kubeapps (see https://github.com/kubeapps/kubeapps/issues/362) but when trying to create a ServiceInstance for Cloud SQL, I'm getting a cryptic error:

Provision call failed: operation "projects/774136762833/operations/32fb22b8-75af-11e8-b9ff-daf13f1b231d/1529625798809591674" failed: generic::invalid_argument: Operation "operation-1529625799000-56f2fc2637fc0-354c5f3f-89a47975" failed with : [{"code":"RESOURCE_ERROR","location":"/deployments/i74a8bc72-6ba4-4de0-b7e5-cd534f4053a2/resources/instance","message":"{\"ResourceType\":\"sqladmin.v1beta4.instance\",\"ResourceErrorCode\":\"400\",\"ResourceErrorMessage\":{\"code\":400,\"errors\":[{\"domain\":\"global\",\"message\":\"Invalid parameter: HostPort ()..\",\"reason\":\"invalid\"}],\"message\":\"Invalid parameter: HostPort ()..\",\"statusMessage\":\"Bad Request\",\"requestPath\":\"https://www.googleapis.com/sql/v1beta4/projects/bitnamigcetest2/instances\",\"httpMethod\":\"POST\"}}"}]

The error appears to be Invalid parameter: HostPort ().. but that is not being set in the Instance parameters, so I'm not sure why that would be happening. Here is the ServiceInstance I am trying to create:

apiVersion: servicecatalog.k8s.io/v1beta1
kind: ServiceInstance
metadata:
  creationTimestamp: 2018-06-21T23:59:56Z
  finalizers:
  - kubernetes-incubator/service-catalog
  generation: 1
  name: db2
  namespace: default
  resourceVersion: "473"
  selfLink: /apis/servicecatalog.k8s.io/v1beta1/namespaces/default/serviceinstances/db2
  uid: 32fb23f0-75af-11e8-b9ff-daf13f1b231d
spec:
  clusterServiceClassExternalName: cloud-sql-mysql
  clusterServiceClassRef:
    name: 85c5e53a-d70b-480e-afd3-737b0b1329f3
  clusterServicePlanExternalName: beta
  clusterServicePlanRef:
    name: 9f62358e-ffb4-4fc5-b7a5-90462c15ce55
  externalID: 32fb22b8-75af-11e8-b9ff-daf13f1b231d
  parameters:
    databaseVersion: MYSQL_5_7
    failoverReplica: {}
    instanceId: adnan-db2
    onPremisesConfiguration: {}
    region: us-central1
    replicaConfiguration:
      mysqlReplicaConfiguration: {}
    settings:
      backupConfiguration: {}
      dataDiskType: PD_SSD
      ipConfiguration: {}
      locationPreference: {}
      maintenanceWindow: {}
      pricingPlan: PER_USE
      storageAutoResize: true
      storageAutoResizeLimit: "0"
      tier: db-n1-standard-1
      userLabels: {}
  updateRequests: 0
status:
  asyncOpInProgress: true
  conditions:
  - lastTransitionTime: 2018-06-21T23:59:58Z
    message: The instance is being deprovisioned asynchronously
    reason: Deprovisioning
    status: "False"
    type: Ready
  - lastTransitionTime: 2018-06-22T00:12:50Z
    message: |-
      Provision call failed: operation "projects/774136762833/operations/32fb22b8-75af-11e8-b9ff-daf13f1b231d/1529626354261133353" failed: generic::invalid_argument: Operation "operation-1529626354652-56f2fe3821362-65888e5a-d57f387b" failed with
      : [{"code":"RESOURCE_ERROR","location":"/deployments/id6f04f3f-10df-499c-9cca-ef99d0906623/resources/instance","message":"{\"ResourceType\":\"sqladmin.v1beta4.instance\",\"ResourceErrorCode\":\"400\",\"ResourceErrorMessage\":{\"code\":400,\"errors\":[{\"domain\":\"global\",\"message\":\"Invalid parameter: HostPort ()..\",\"reason\":\"invalid\"}],\"message\":\"Invalid parameter: HostPort ()..\",\"statusMessage\":\"Bad Request\",\"requestPath\":\"https://www.googleapis.com/sql/v1beta4/projects/bitnamigcetest2/instances\",\"httpMethod\":\"POST\"}}"}]
    reason: ProvisionCallFailed
    status: "True"
    type: OrphanMitigation
  currentOperation: Provision
  deprovisionStatus: Required
  inProgressProperties:
    clusterServicePlanExternalID: 9f62358e-ffb4-4fc5-b7a5-90462c15ce55
    clusterServicePlanExternalName: beta
    parameterChecksum: 652a49c3f12b51731576103822bdc432994e9e7a56b415c721a5783b2944b003
    parameters:
      databaseVersion: MYSQL_5_7
      failoverReplica: {}
      instanceId: adnan-db2
      onPremisesConfiguration: {}
      region: us-central1
      replicaConfiguration:
        mysqlReplicaConfiguration: {}
      settings:
        backupConfiguration: {}
        dataDiskType: PD_SSD
        ipConfiguration: {}
        locationPreference: {}
        maintenanceWindow: {}
        pricingPlan: PER_USE
        storageAutoResize: true
        storageAutoResizeLimit: "0"
        tier: db-n1-standard-1
        userLabels: {}
  lastOperation: 32fb22b8-75af-11e8-b9ff-daf13f1b231d/1529626371223350409
  observedGeneration: 1
  operationStartTime: 2018-06-22T00:12:33Z
  orphanMitigationInProgress: true
  provisionStatus: NotProvisioned
  reconciledGeneration: 0

If this is the wrong repository to file this in, sorry - let me know where I should be filing this!

arapulido commented 6 years ago

@prydonius I think the right repo should be https://github.com/GoogleCloudPlatform/gcp-service-broker

martinmaly commented 6 years ago

I believe this is the correct place.

khipkin commented 6 years ago

Hi, @prydonius. This is the correct place to report your issue. We are looking into it.

prydonius commented 6 years ago

@khipkin thanks, sorry for duplicating it!

khipkin commented 6 years ago

As a workaround, your instance should provision successfully if you completely omit the onPremisesConfiguration object. We are working on a more robust fix internally.

prydonius commented 6 years ago

@khipkin interesting, I think we'll have to wait for the fix in the Kubeapps UI since we render a JSON schema form that will leave that parameter as an empty object. We could workaround to set empty objects as undefined, but probably not worth it.

kibbles-n-bytes commented 6 years ago

Sorry for the delay. We've confirmed with the Cloud SQL team that this is not an issue with our service, but that the underlying API we reach out to is rejecting the request with an obscure error message. The CloudSQL team has chosen to still interpret this as an error case, but changed the error message so it is not as obscure.

If you want to follow-up further with the CloudSQL team, please get in touch with them by creating an issue on their issue tracker here. (Scroll down to the "Create new Cloud SQL Issue" link).

Going to close this for now as it's out of our hands, but if there's anything we could still help out with let me know!