databricks / databricks-sdk-go

Databricks SDK for Go
https://docs.databricks.com/dev-tools/sdk-go.html
Apache License 2.0
52 stars 42 forks source link

[ISSUE] Error while dropping `databricks_mws_networks` #777

Closed apwrk closed 9 months ago

apwrk commented 10 months ago

Description Terraform throws error

╷
│ Error: cannot delete mws networks: unexpected error handling request: unexpected end of JSON input. This is likely a bug in the Databricks SDK for Go or the underlying REST API. Please report this issue with the following debugging information to the SDK issue tracker at https://github.com/databricks/databricks-sdk-go/issues. Request log:
│ ```
│ DELETE /api/2.0/accounts/*****-****-*****-****-*******/networks/6d417898-7098-4c5a-b86a-65fe21ba8e12
│ > * Host: 
│ > * Accept: application/json
│ > * Authorization: REDACTED
│ > * User-Agent: databricks-tf-provider/1.33.0 databricks-sdk-go/0.28.1 go/1.20.12 os/linux terraform/1.5.0 resource/mws_networks auth/oauth-m2m
│ < HTTP/2.0 409 Conflict (Error: unexpected end of JSON input)
│ < * Content-Length: 0
│ < * Date: Tue, 23 Jan 2024 12:31:57 GMT
│ < * Server: databricks
│ < * Strict-Transport-Security: max-age=31536000; includeSubDomains; preloadmax-age=31536000; includeSubDomains; preload
│ < * X-Content-Type-Options: nosniffnosniff
│ < * X-Frame-Options: SAMEORIGIN
│ < * X-Xss-Protection: 1; mode=block
│ ```

provider version used

    databricks = {
      source  = "databricks/databricks"
      version = "1.33.0"
    }

Reproduction

  1. Create databricks_mws_networks using terraform
  2. Remove the resource from configuration

Expected behavior It is expected the databricks_mws_networks resource is dropped without error

edwardfeng-db commented 9 months ago

Thanks for raising. This seems to be a problem with the underlying API. I have pinged the internal team owning that API. Will get back to you once we have an update

edwardfeng-db commented 9 months ago

@apwrk According to our internal team409 is likely due to network being attached to a RUNNING workspace. The error message for this API should be fixed recently and if you retry you should see a more concrete error message