Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] Issue with databricks_metastore_assignment resource #2061

Closed
francisco-ltech opened this issue Mar 2, 2023 · 2 comments
Closed

[ISSUE] Issue with databricks_metastore_assignment resource #2061

francisco-ltech opened this issue Mar 2, 2023 · 2 comments
Labels
needs-api changes to Databricks Platform APIs are required

Comments

@francisco-ltech
Copy link

Configuration

resource "databricks_metastore_assignment" "assignment" {
  metastore_id         = var.metastore-id
  workspace_id         = azurerm_databricks_workspace.build.workspace_id
  default_catalog_name = "default"
}

Expected Behavior

Databricks workspace to be assigned to the given (existing) metastore

Actual Behavior

Error: cannot read metastore assignment: No metastore assigned for the current workspace.

Steps to Reproduce

Metastore already exists, new Databricks workspace is created, then assigned.

  1. terraform plan
  2. terraform apply

Terraform and provider versions

azurerm = {
source = "hashicorp/azurerm"
version = "3.45.0"
}
databricks = {
source = "databricks/databricks"
version = "1.11.1"
}

Debug Output

[DEBUG] provider.terraform-provider-databricks_v1.11.1: PUT /api/2.1/unity-catalog/workspaces/{id}/metastore

{
"default_catalog_name": "default",
"metastore_id": "uuid-value",
"workspace_id": int-value
}
< HTTP/2.0 200 OK
< {}: timestamp=2023-03-02T14:21:19.338Z
[DEBUG] provider.terraform-provider-databricks_v1.11.1: GET /api/2.1/unity-catalog/metastore_summary
< HTTP/2.0 404 Not Found
< {
< "details": [
< {
< "@type": "type.googleapis.com/google.rpc.RequestInfo",
< "request_id": "17e-8bf-4da-b23-b12",
< "serving_data": ""
< }
< ],
< "error_code": "METASTORE_DOES_NOT_EXIST",
< "message": "No metastore assigned for the current workspace."

Important Factoids

  • The actual PUT request to the assignment reads a OK which indicates success, which indeed succeeds because I can see the metastore assigned to the workspace in the accounts.databricks portal.
  • However, there seems to be a subsequent GET request that fails and I believe this makes TF not to update the state?
  • If I terraform plan again, the plan indicates the assignment is yet to be created (again).
@nkvuong
Copy link
Contributor

nkvuong commented Mar 3, 2023

this is a known issue with the databricks_metastore_assignment resource if you're running it on a workspace that is not Unity Catalog enabled.

Engineering team is building support for metastore APIs at account-level, which should resolve this issue (and other similar ones)

@nkvuong nkvuong added the needs-api changes to Databricks Platform APIs are required label Mar 3, 2023
@nkvuong
Copy link
Contributor

nkvuong commented Aug 30, 2023

fixed in #2182

@nkvuong nkvuong closed this as completed Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-api changes to Databricks Platform APIs are required
Projects
None yet
Development

No branches or pull requests

2 participants