Skip to content

Fix deployment failing when app is in DELETING state - #4102

Merged
andrewnester merged 6 commits into
databricks:mainfrom
varundeepsaini:fix/app-deleting
Dec 22, 2025
Merged

Fix deployment failing when app is in DELETING state#4102
andrewnester merged 6 commits into
databricks:mainfrom
varundeepsaini:fix/app-deleting

Conversation

@varundeepsaini

@varundeepsainivarundeepsaini commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

Fixes: #4006

Changes

Added a wait for apps in DELETING state to be fully deleted before deployment proceeds.

Why

Deployment fails when an app is in DELETING state because the app still exists but is being removed. This adds a pre-deployment check that polls and waits (up to 5 minutes) for apps to finish deleting.

@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

Hey @andrewnester
Could you please review this pr

@denik

denik commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

@varundeepsaini thanks for the PR. Generally, any waiting that is resource-related should be done in the deployment DAG (so in bundle/direct/dresources for direct engine & terraform provider for terraform engine) (for performance). I don't see why this case would warrant an exception.

@varundeepsaini

varundeepsaini commented Dec 6, 2025

Copy link
Copy Markdown
ContributorAuthor

@denik
Have updated the changes here, will do the same in the Terraform provider as well
Please queue the tests once you review the changes

Edit: Terraform changes: #5263

Comment threadbundle/direct/dresources/app.go Outdated
Comment threadbundle/direct/dresources/app.go Outdated
@github-actions

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 4102
  • Commit SHA: 0f31f501eab03fab98a51c1b1838f9146f7af6bf

Checks will be approved automatically on success.

@varundeepsaini

varundeepsaini commented Dec 9, 2025

Copy link
Copy Markdown
ContributorAuthor

Hey @andrewnester
Have made the requested changes

@varundeepsaini

Copy link
Copy Markdown
ContributorAuthor

@andrewnester bump ^^

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Dec 22, 2025

Copy link
Copy Markdown
Collaborator

Commit: 0f31f50

Run: 20435955643

Env❌​FAIL🟨​KNOWN💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
❌​aws linux39111375665200:20
❌​aws windows3146137766365:03
❌​aws-ucws linux35151526542206:52
❌​aws-ucws windows310101528540190:43
❌​azure linux43113375663231:30
❌​azure-ucws linux33113523540204:58
❌​azure-ucws windows286352653860:39
🟨​gcp linux212336866921:25
🟨​gcp windows77337066719:33
25 interesting tests: 14 KNOWN, 6 RECOVERED, 4 FAIL, 1 SKIP
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
🟨​TestAccept🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K💚​R💚​R
❌​TestAccept/bundle/deployment/bind/alert🙈​s🙈​s🙈​s🙈​s❌​F✅​p✅​p✅​p✅​p
❌​TestAccept/bundle/resources/alerts/basic❌​F❌​F❌​F❌​F❌​F❌​F❌​F✅​p✅​p
❌​TestAccept/bundle/resources/alerts/basic/DATABRICKS_BUNDLE_ENGINE=direct❌​F❌​F❌​F❌​F❌​F❌​F❌​F✅​p✅​p
❌​TestAccept/bundle/resources/alerts/basic/DATABRICKS_BUNDLE_ENGINE=terraform❌​F❌​F❌​F❌​F❌​F❌​F✅​p✅​p✅​p
🙈​TestAccept/bundle/resources/permissions🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions🟨​K🟨​K🟨​K🟨​K🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K🟨​K🟨​K
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
💚​TestFsRmNonEmptyDirectory💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestFsRmNonEmptyDirectory/dbfs💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
🟨​TestExport🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K
🟨​TestExportWithFileFlag🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K
🟨​TestImportDir💚​R🟨​K💚​R🟨​K💚​R💚​R🟨​K💚​R🟨​K
🟨​TestImportDirDoesNotOverwrite💚​R🟨​K💚​R🟨​K💚​R💚​R🟨​K💚​R🟨​K
🟨​TestImportDirWithOverwriteFlag💚​R🟨​K💚​R🟨​K💚​R💚​R🟨​K💚​R🟨​K
🟨​TestImportFileFormatAuto💚​R🟨​K💚​R🟨​K💚​R💚​R🟨​K💚​R🟨​K
🟨​TestImportFileFormatSource💚​R🟨​K💚​R🟨​K💚​R💚​R🟨​K💚​R🟨​K
💚​TestFilerReadWrite💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestFilerReadWrite/dbfs💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestFilerRecursiveDelete💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestFilerRecursiveDelete/dbfs💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
Top 22 slowest tests (at least 2 minutes):
durationenvtestname
9:36azure-ucws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
7:24azure-ucws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
7:04aws-ucws windowsTestAccept/bundle/resources/synced_database_tables/basic
6:46aws-ucws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
6:25aws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
6:17aws windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:50aws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:48aws windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:47gcp windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:42gcp windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:37aws-ucws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:34aws-ucws linuxTestAccept/bundle/resources/synced_database_tables/basic
5:26gcp linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:17gcp linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:34azure linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:02azure-ucws windowsTestAccept/bundle/resources/synced_database_tables/basic
3:54azure linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
3:34azure-ucws linuxTestAccept/bundle/resources/synced_database_tables/basic
2:34aws-ucws windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
2:15gcp linuxTestAccept
2:09aws-ucws windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:02azure-ucws windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct

@andrewnester
andrewnester merged commit d79a4c2 into databricks:mainDec 22, 2025
23 of 24 checks passed
@varundeepsaini
varundeepsaini deleted the fix/app-deleting branch December 22, 2025 17:05
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Commit: d79a4c2

Run: 20438126157

Env❌​FAIL🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
❌​aws linux39111411651208:18
❌​aws windows5146141164981:10
❌​aws-ucws linux35151580522225:11
❌​aws-ucws windows310101582520219:18
❌​azure linux43113411649227:17
❌​azure windows4863413647237:34
❌​azure-ucws linux434113572520261:01
❌​azure-ucws windows1186357151884:31
🟨​gcp linux212339565851:24
🟨​gcp windows77339765652:14
38 interesting tests: 14 KNOWN, 13 FAIL, 6 RECOVERED, 4 flaky, 1 SKIP
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
🟨​TestAccept🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K💚​R💚​R
❌​TestAccept/bundle/deployment/bind/alert🙈​s🙈​s🙈​s🙈​s❌​F❌​F❌​F❌​F✅​p✅​p
❌​TestAccept/bundle/integration_whl/interactive_cluster✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p✅​p
❌​TestAccept/bundle/integration_whl/interactive_cluster/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p✅​p
❌​TestAccept/bundle/integration_whl/interactive_single_user✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p✅​p
❌​TestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p✅​p
❌​TestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p✅​p
❌​TestAccept/bundle/resources/alerts/basic❌​F❌​F❌​F❌​F❌​F❌​F❌​F❌​F✅​p✅​p
❌​TestAccept/bundle/resources/alerts/basic/DATABRICKS_BUNDLE_ENGINE=direct❌​F❌​F❌​F❌​F❌​F❌​F❌​F❌​F✅​p✅​p
❌​TestAccept/bundle/resources/alerts/basic/DATABRICKS_BUNDLE_ENGINE=terraform❌​F❌​F❌​F❌​F❌​F❌​F❌​F❌​F✅​p✅​p
🔄​TestAccept/bundle/resources/clusters/run/spark_python_task/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p
🔄​TestAccept/bundle/resources/clusters/run/spark_python_task/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p
❌​TestAccept/bundle/resources/dashboards/detect-change✅​p❌​F✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p
❌​TestAccept/bundle/resources/dashboards/detect-change/DATABRICKS_BUNDLE_ENGINE=terraform✅​p❌​F✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p
🙈​TestAccept/bundle/resources/permissions🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions🟨​K🟨​K🟨​K🟨​K🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K🟨​K🟨​K
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🔄​TestAccept/bundle/resources/secret_scopes/permissions✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p🙈​s🙈​s
🔄​TestAccept/bundle/resources/secret_scopes/permissions/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p
❌​TestAccept/bundle/run/app-with-job✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p✅​p
❌​TestAccept/bundle/run/app-with-job/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p❌​F✅​p✅​p
💚​TestFsRmNonEmptyDirectory💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestFsRmNonEmptyDirectory/dbfs💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
🟨​TestExport🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K
🟨​TestExportWithFileFlag🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K🟨​K
🟨​TestImportDir💚​R🟨​K💚​R🟨​K💚​R🟨​K💚​R🟨​K💚​R🟨​K
🟨​TestImportDirDoesNotOverwrite💚​R🟨​K💚​R🟨​K💚​R🟨​K💚​R🟨​K💚​R🟨​K
🟨​TestImportDirWithOverwriteFlag💚​R🟨​K💚​R🟨​K💚​R🟨​K💚​R🟨​K💚​R🟨​K
🟨​TestImportFileFormatAuto💚​R🟨​K💚​R🟨​K💚​R🟨​K💚​R🟨​K💚​R🟨​K
🟨​TestImportFileFormatSource💚​R🟨​K💚​R🟨​K💚​R🟨​K💚​R🟨​K💚​R🟨​K
💚​TestFilerReadWrite💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestFilerReadWrite/dbfs💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestFilerRecursiveDelete💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestFilerRecursiveDelete/dbfs💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
Top 50 slowest tests (at least 2 minutes):
durationenvtestname
18:09azure-ucws linuxTestAccept/bundle/resources/permissions/factcheck/DATABRICKS_BUNDLE_ENGINE=terraform
12:23gcp windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=direct
12:16gcp linuxTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform
12:10azure windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
12:09aws-ucws windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
12:03gcp windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
11:59azure windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=direct
11:26aws-ucws linuxTestAccept/bundle/resources/model_serving_endpoints/running-endpoint/DATABRICKS_BUNDLE_ENGINE=terraform
11:07gcp linuxTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=SINGLE_USER
11:03aws windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=SINGLE_USER
10:52aws-ucws windowsTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform
10:51aws windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
10:36aws-ucws linuxTestAccept/bundle/resources/model_serving_endpoints/running-endpoint/DATABRICKS_BUNDLE_ENGINE=direct
10:07gcp windowsTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform
10:03azure-ucws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
9:53aws-ucws windowsTestAccept/bundle/resources/model_serving_endpoints/running-endpoint/DATABRICKS_BUNDLE_ENGINE=direct
9:43gcp windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=SINGLE_USER
9:28azure-ucws linuxTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform
9:21aws windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=USER_ISOLATION
9:15aws-ucws windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=USER_ISOLATION
9:11azure-ucws linuxTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=direct
8:57aws-ucws windowsTestAccept/bundle/resources/model_serving_endpoints/running-endpoint/DATABRICKS_BUNDLE_ENGINE=terraform
8:43azure linuxTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=direct
8:37azure-ucws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
8:35azure-ucws windowsTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
8:33azure-ucws windowsTestSparkJarTaskDeployAndRunOnVolumes/Databricks_Runtime_15.4_LTS
8:28azure linuxTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
8:24aws linuxTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform
8:20aws windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=SINGLE_USER
8:17azure-ucws linuxTestSparkJarTaskDeployAndRunOnVolumes/Databricks_Runtime_15.4_LTS
8:06aws windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=USER_ISOLATION
8:05aws-ucws linuxTestAccept/bundle/integration_whl/interactive_cluster/DATABRICKS_BUNDLE_ENGINE=terraform
8:04azure windowsTestSparkJarTaskDeployAndRunOnWorkspace/Databricks_Runtime_15.4_LTS
8:02gcp linuxTestAccept/bundle/integration_whl/interactive_cluster/DATABRICKS_BUNDLE_ENGINE=terraform
8:01azure linuxTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=terraform
8:01aws linuxTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
8:01gcp windowsTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=USER_ISOLATION
7:59aws linuxTestSparkJarTaskDeployAndRunOnWorkspace/Databricks_Runtime_15.4_LTS
7:57gcp linuxTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=direct
7:57aws-ucws windowsTestAccept/bundle/integration_whl/interactive_single_user/DATABRICKS_BUNDLE_ENGINE=direct
7:56gcp linuxTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=direct/DATA_SECURITY_MODE=USER_ISOLATION
7:55aws-ucws windowsTestSparkJarTaskDeployAndRunOnVolumes/Databricks_Runtime_15.4_LTS
7:55aws-ucws linuxTestAccept/bundle/integration_whl/interactive_cluster_dynamic_version/DATABRICKS_BUNDLE_ENGINE=terraform/DATA_SECURITY_MODE=USER_ISOLATION
7:54gcp linuxTestAccept/bundle/integration_whl/interactive_cluster/DATABRICKS_BUNDLE_ENGINE=direct
7:54aws windowsTestSparkJarTaskDeployAndRunOnWorkspace/Databricks_Runtime_15.4_LTS
7:51azure-ucws linuxTestSparkJarTaskDeployAndRunOnVolumes/Databricks_Runtime_14.3_LTS
7:49azure-ucws linuxTestAccept/bundle/integration_whl/base/DATABRICKS_BUNDLE_ENGINE=terraform
7:47gcp linuxTestSparkJarTaskDeployAndRunOnWorkspace/Databricks_Runtime_15.4_LTS
7:44gcp linuxTestAccept/bundle/run/app-with-job/DATABRICKS_BUNDLE_ENGINE=direct
7:42azure-ucws windowsTestSparkJarTaskDeployAndRunOnVolumes/Databricks_Runtime_13.3_LTS

@denik

Copy link
Copy Markdown
Contributor

@varundeepsaini@andrewnester I left a comment on the ticket, please check #4006 (comment)

github-merge-queueBot pushed a commit that referenced this pull request Jan 2, 2026
## Description
Moves app deletion wait from `DoDelete` to `DoCreate`, and only retries
when appropriate.
## Changes
- On `RESOURCE_ALREADY_EXISTS` error, check app state via GET before
retrying
- Only retry if the app is in `DELETING` state or was just deleted (404)
- Return hard error if app exists in any other state (e.g., `ACTIVE`)
## Why?
- Handles apps deleted externally (manual deletion), not just via
`bundle destroy`
- Avoids unnecessary latency in destroy operations
- Fixes the issue at the point of failure (create, not delete)
- Prevents infinite retries when app exists and is not being deleted
Follow up to #4102, addresses feedback from #4006.
---------
Co-authored-by: Denis Bilenko <denis.bilenko@databricks.com>
denik pushed a commit that referenced this pull request May 20, 2026
Fixes: #4006
## Changes
Added a wait for apps in `DELETING` state to be fully deleted before
deployment proceeds.
## Why
Deployment fails when an app is in `DELETING` state because the app
still exists but is being removed. This adds a pre-deployment check that
polls and waits (up to 5 minutes) for apps to finish deleting.
denik added a commit that referenced this pull request May 20, 2026
## Description
Moves app deletion wait from `DoDelete` to `DoCreate`, and only retries
when appropriate.
## Changes
- On `RESOURCE_ALREADY_EXISTS` error, check app state via GET before
retrying
- Only retry if the app is in `DELETING` state or was just deleted (404)
- Return hard error if app exists in any other state (e.g., `ACTIVE`)
## Why?
- Handles apps deleted externally (manual deletion), not just via
`bundle destroy`
- Avoids unnecessary latency in destroy operations
- Fixes the issue at the point of failure (create, not delete)
- Prevents infinite retries when app exists and is not being deleted
Follow up to #4102, addresses feedback from #4006.
---------
Co-authored-by: Denis Bilenko <denis.bilenko@databricks.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deploying an app immediately after it is deleted fails

4 participants

@varundeepsaini@denik@eng-dev-ecosystem-bot@andrewnester