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

databricks_sql_table context deadline exceeded #4230

Open
jiropardo opened this issue Nov 14, 2024 · 0 comments
Open

databricks_sql_table context deadline exceeded #4230

jiropardo opened this issue Nov 14, 2024 · 0 comments

Comments

@jiropardo
Copy link
Contributor

jiropardo commented Nov 14, 2024

Configuration

# Copy-paste your Terraform configuration here

resource "databricks_sql_table" "event_table" {
provider = databricks.workspace
name = "usageEvents"

catalog_name = "test_catalog"
schema_name = "test-schema"
table_type = "MANAGED"
data_source_format = "DELTA"

column {
name = "key"
type = "string"
}
column {
name = "value"
type = "string"
}
column {
name = "partition"
type = "int"
}
column {
name = "offset"
type = "bigint"
}
column {
name = "timestamp"
type = "timestamp"
}

cluster_keys = ["key","timestamp"]

warehouse_id = "XXXXXXXXXXXXXX"

}

Expected Behavior

The resource databricks_sql_table spins up a SQL warehouse to run a SQL query to create the table if SQL warehouse is not running. We expect the table creation to succeed all times

Actual Behavior

Trying to create a table using a non running Classic or PRO SQL Warehouse will fail with below error as it waits for the SQL Warehouse to spin up

2024-11-13T23:53:41.261-0600 [ERROR] vertex "databricks_sql_table.event_table" error: cannot create sql table: Post "https://xxxxxxxxxxx.cloud.databricks.com/api/2.0/sql/statements/": context deadline exceeded

Steps to Reproduce

Create a databricks_sql_table referencing a not running PRO / Classic warehouse

Terraform and provider versions

Databricks provider v1.58.0

Is it a regression?

Debug Output

From the Execute to the failure there was only 50 secs wait while spinning a PRO/classic warehouse may take up to 5 mins sometimes

2024-11-13T23:52:51.229-0600 [INFO] provider.terraform-provider-databricks_v1.58.0: [INFO] Executing Sql: CREATE TABLE test_catalog.test-schema.usageEvents (key string, value string, partition int, offset bigint, timestamp timestamp)

databricks_sql_table.event_table: Still creating... [50s elapsed]

2024-11-13T23:53:41.239-0600 [DEBUG] provider.terraform-provider-databricks_v1.58.0: POST /api/2.0/sql/statements/

{
"on_wait_timeout": "CANCEL",
"statement": "CREATE TABLE test_catalog.test-schema.quickstart_table (id int, name string COMMENT 'name of thing')\nUSING DELTA\nCOMMENT 'this table is managed by terraform';",
"wait_timeout": "50s",
"warehouse_id": "XXXXXXXXXXXXXX""
}

2024-11-13T23:53:41.261-0600 [ERROR] vertex "databricks_sql_table.event_table" error: cannot create sql table: Post "https://XXXXXXXX.cloud.databricks.com/api/2.0/sql/statements/": context deadline exceeded

Important Factoids

We would like a longer time out or some retries for the context deadline exceeded error

Would you like to implement a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant