Skip to content

direct: use the Lakebase catalog a failed create request created - #7801

Merged
denik merged 2 commits into
mainfrom
denik/lakebase-catalog-create-recovery
Nov 19, 2026
Merged

denik merged 2 commits into
mainfrom
denik/lakebase-catalog-create-recovery

Conversation

@denik

@denik denik commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Changes

Lakebase catalog creates now recover from transient errors the way postgres branches, projects and roles already do (#7602, #7747, #7767). Until now, database_catalogs and postgres_catalogs failed the deploy on any create error. If the catalog had actually been created, the next deploy also failed, with "already exists".

  • postgres_catalogs: on a transient error (5xx, 408, inactivity timeout), recoverPostgresCreate looks the catalog up. It uses the catalog if its create_time shows this deployment created it, and repeats the create while the catalog is missing. This is the same code path roles use.
  • database_catalogs: these use the generic recoverCreate, as features, serving endpoints and AI Gateway services do (#7757, #7782). The Database API returns no create time, so the time check uses created_at of the Unity Catalog catalog the database catalog registers. I checked on AWS that it is there, with catalog_type: MANAGED_ONLINE_CATALOG. If the database catalog exists but its UC catalog can't be found, the deploy fails with "has no create time" rather than repeating the create.
  • Both APIs answer a duplicate create with 400 CATALOG_ALREADY_EXISTS ("Catalog '...' already exists"; checked on AWS). isPostgresAlreadyExists already matches that response. isAlreadyExists now matches it as well, so a repeated database catalog create that lands after an earlier one triggers another lookup.

Testserver, to match the cloud:

  • A database catalog create also registers the UC catalog with created_at, and the delete removes it.
  • A missing database catalog returns 404 CATALOG_DOES_NOT_EXIST instead of a plain-text 404. Without the error code the SDK doesn't report it as missing.
  • A duplicate database or postgres catalog returns 400 CATALOG_ALREADY_EXISTS, not 409 or silently overwriting.

Judgment calls:

  • postgres_catalogs gates recovery on retry.IsTransient, like its postgres siblings, not on the wider isUncertainCreateError (499, stream resets). Neither of those has been seen on Lakebase creates.
  • A recovered postgres catalog is used as soon as GET finds it, as with roles. The catalog has no readiness state to wait on.

Why

These create errors fail cloud runs on main. The two dashboard errors this PR fixes:

Dashboard

error failure
error/2208 Error: cannot create resources.database_catalogs.my_catalog: (504 DEADLINE_EXCEEDED) (Azure, 4 failures since 2026-10-26)
error/3554 Error: cannot create resources.postgres_catalogs.my_catalog: The request could not be processed. Please try again later and contact Databricks if the problem persists. [TraceId: [TRACE_ID]] (500 INTERNAL_ERROR) (AWS, GCP)

Tests: TestAccept/bundle/resources/synced_database_tables/basic/DMS=, TestAccept/bundle/resources/synced_database_tables/basic/DMS=true, TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=true

Tests

  • New acceptance tests use injected faults: database_catalogs/create_504 covers a catalog created despite a 504, a catalog that was not created, a catalog that only shows up after the repeat hits "already exists", and an unreadable catalog. postgres_catalogs/create_transient_500 covers created, not created (504) and unreadable.
  • Unit tests cover catalogs that predate the deploy (not taken over), a missing create time, and a missing UC catalog.
  • Ran the full local acceptance suite. Probed on AWS with testme-aws: UC created_at on a database catalog, and the duplicate-create error from both APIs.

This pull request and its description were written by Isaac.

database_catalogs and postgres_catalogs creates now get the same recovery
as postgres branches, projects and roles: on a transient error, look the
catalog up, use it if this deployment created it, and repeat the create
while it is missing.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik denik added the ai-auto Deprecated: use factory-generated instead. label Nov 19, 2026
cloud: TestAccept/bundle/resources/database_catalogs TestAccept/bundle/resources/postgres_catalogs TestAccept/bundle/resources/synced_database_tables/basic TestAccept/bundle/resources/postgres_synced_tables/basic

Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added the DABs DABs related issues label Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Commit: a2d3ad0c1 | Workflow run

Regression test report

Selected 2 changed tests (limit=20, 0 not selected)

16 tests: regression=4 unreleased=0 coverage=12 failing=0
test branch main (ab7c938) latest (v1.27.0)
TestAccept/bundle/resources/database_catalogs/basic/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/database_catalogs/basic/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/database_catalogs/create_504/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/database_catalogs/create_504/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/database_catalogs/recreate/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/database_catalogs/recreate/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/postgres_catalogs/basic/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/postgres_catalogs/basic/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/postgres_catalogs/create_transient_500/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/postgres_catalogs/create_transient_500/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/postgres_catalogs/recreate/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/postgres_catalogs/recreate/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/postgres_synced_tables/basic/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/synced_database_tables/basic/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/synced_database_tables/basic/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/database_catalogs/create_504/DMS=: branch ✅ | main (ab7c938) ❌ | latest (v1.27.0) ❌

main (ab7c938):

acceptance_test.go:1388: Diff:
        --- bundle/resources/database_catalogs/create_504/output.txt
        +++ /tmp/TestAcceptbundleresourcesdatabase_catalogscreate_504DMS=2901027787/002/output.txt
        @@ -3,54 +3,7 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created database_catalogs.my_catalog
         Created database_instances.my_instance
        -Files: 0 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        ->>> print_requests.py --get //database/catalogs //unity-catalog/catalogs
        -POST /api/2.0/database/catalogs
        -GET /api/2.0/database/catalogs/my_catalog
        -GET /api/2.1/unity-catalog/catalogs/my_catalog
        -
        -=== The create request times out and the catalog was not created: deploy repeats the create
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created database_instances.my_instance
        -Warn: deploying resources.database_catalogs.my_catalog: retrying after 504 Gateway Timeout from POST /api/2.0/database/catalogs
        -Created database_catalogs.my_catalog
        -Files: 0 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        ->>> print_requests.py --get //database/catalogs //unity-catalog/catalogs
        -POST /api/2.0/database/catalogs
        -GET /api/2.0/database/catalogs/my_catalog
        -POST /api/2.0/database/catalogs
        -
        -=== The create request times out, the catalog shows up only after the create is repeated: deploy uses the catalog
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created database_instances.my_instance
        -Warn: deploying resources.database_catalogs.my_catalog: retrying after 504 Gateway Timeout from POST /api/2.0/database/catalogs
        -Created database_catalogs.my_catalog
        -Files: 0 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        ->>> print_requests.py --get //database/catalogs //unity-catalog/catalogs
        -POST /api/2.0/database/catalogs
        -GET /api/2.0/database/catalogs/my_catalog
        -POST /api/2.0/database/catalogs
        -GET /api/2.0/database/catalogs/my_catalog
        -GET /api/2.1/unity-catalog/catalogs/my_catalog
        -
        -=== The catalog cannot be read after the create request times out: deploy fails with the create error
        -
        ->>> musterr [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created database_instances.my_instance
        -Warn: deploying resources.database_catalogs.my_catalog: checking whether database catalog my_catalog was created: Fault injected by test.
         Error: cannot create resources.database_catalogs.my_catalog: Fault injected by test. (504 DEADLINE_EXCEEDED)
         
         Endpoint: POST [DATABRICKS_URL]/api/2.0/database/catalogs
        @@ -60,6 +12,4 @@
         
         Files: 0 uploaded, 0 deleted
         
        ->>> print_requests.py --get //database/catalogs //unity-catalog/catalogs
        -POST /api/2.0/database/catalogs
        -GET /api/2.0/database/catalogs/my_catalog
        +Exit code: 1
        
    acceptance_test.go:1178: Test produced unexpected files:
        .databricks/.gitignore
        .databricks/bundle/default/deployment.json
        .databricks/bundle/default/resources.json

latest (v1.27.0): same output as main (ab7c938)

TestAccept/bundle/resources/database_catalogs/create_504/DMS=true: branch ✅ | main (ab7c938) ❌ | latest (v1.27.0) ❌

main (ab7c938):

acceptance_test.go:1388: Diff:
        --- bundle/resources/database_catalogs/create_504/output.txt
        +++ /tmp/TestAcceptbundleresourcesdatabase_catalogscreate_504DMS=tru2895677248/002/output.txt
        @@ -3,54 +3,7 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created database_catalogs.my_catalog
         Created database_instances.my_instance
        -Files: 0 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        ->>> print_requests.py --get //database/catalogs //unity-catalog/catalogs
        -POST /api/2.0/database/catalogs
        -GET /api/2.0/database/catalogs/my_catalog
        -GET /api/2.1/unity-catalog/catalogs/my_catalog
        -
        -=== The create request times out and the catalog was not created: deploy repeats the create
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created database_instances.my_instance
        -Warn: deploying resources.database_catalogs.my_catalog: retrying after 504 Gateway Timeout from POST /api/2.0/database/catalogs
        -Created database_catalogs.my_catalog
        -Files: 0 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        ->>> print_requests.py --get //database/catalogs //unity-catalog/catalogs
        -POST /api/2.0/database/catalogs
        -GET /api/2.0/database/catalogs/my_catalog
        -POST /api/2.0/database/catalogs
        -
        -=== The create request times out, the catalog shows up only after the create is repeated: deploy uses the catalog
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created database_instances.my_instance
        -Warn: deploying resources.database_catalogs.my_catalog: retrying after 504 Gateway Timeout from POST /api/2.0/database/catalogs
        -Created database_catalogs.my_catalog
        -Files: 0 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        ->>> print_requests.py --get //database/catalogs //unity-catalog/catalogs
        -POST /api/2.0/database/catalogs
        -GET /api/2.0/database/catalogs/my_catalog
        -POST /api/2.0/database/catalogs
        -GET /api/2.0/database/catalogs/my_catalog
        -GET /api/2.1/unity-catalog/catalogs/my_catalog
        -
        -=== The catalog cannot be read after the create request times out: deploy fails with the create error
        -
        ->>> musterr [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created database_instances.my_instance
        -Warn: deploying resources.database_catalogs.my_catalog: checking whether database catalog my_catalog was created: Fault injected by test.
         Error: cannot create resources.database_catalogs.my_catalog: Fault injected by test. (504 DEADLINE_EXCEEDED)
         
         Endpoint: POST [DATABRICKS_URL]/api/2.0/database/catalogs
        @@ -60,6 +12,4 @@
         
         Files: 0 uploaded, 0 deleted
         
        ->>> print_requests.py --get //database/catalogs //unity-catalog/catalogs
        -POST /api/2.0/database/catalogs
        -GET /api/2.0/database/catalogs/my_catalog
        +Exit code: 1
        
    acceptance_test.go:1178: Test produced unexpected files:
        .databricks/.gitignore
        .databricks/bundle/default/deployment.json
        .databricks/bundle/default/resources.json
FAIL

latest (v1.27.0): same output as main (ab7c938)

TestAccept/bundle/resources/postgres_catalogs/create_transient_500/DMS=: branch ✅ | main (ab7c938) ❌ | latest (v1.27.0) ❌

main (ab7c938):

acceptance_test.go:1388: Diff:
        --- bundle/resources/postgres_catalogs/create_transient_500/output.txt
        +++ /tmp/TestAcceptbundleresourcespostgres_catalogscreate_transient_53006614606/002/output.txt
        @@ -3,37 +3,7 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created postgres_catalogs.my_catalog
         Created postgres_projects.my_project
        -Files: 0 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        ->>> print_requests.py --get //postgres/catalogs
        -POST /api/2.0/postgres/catalogs
        -GET /api/2.0/postgres/catalogs/lakebase_test
        -
        -=== The create request times out and the catalog was not created: deploy repeats the create
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created postgres_projects.my_project
        -Warn: deploying resources.postgres_catalogs.my_catalog: retrying after 504 Gateway Timeout from POST /api/2.0/postgres/catalogs
        -Created postgres_catalogs.my_catalog
        -Files: 0 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        ->>> print_requests.py --get //postgres/catalogs
        -POST /api/2.0/postgres/catalogs
        -GET /api/2.0/postgres/catalogs/lakebase_test
        -POST /api/2.0/postgres/catalogs
        -GET /api/2.0/postgres/catalogs/lakebase_test/operations/[UUID]
        -
        -=== The catalog cannot be read after the create request fails: deploy fails with the create error
        -
        ->>> musterr [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created postgres_projects.my_project
        -Warn: deploying resources.postgres_catalogs.my_catalog: checking whether catalogs/lakebase_test was created: Fault injected by test.
         Error: cannot create resources.postgres_catalogs.my_catalog: Fault injected by test. (500 INTERNAL_ERROR)
         
         Endpoint: POST [DATABRICKS_URL]/api/2.0/postgres/catalogs?catalog_id=lakebase_test
        @@ -43,6 +12,4 @@
         
         Files: 0 uploaded, 0 deleted
         
        ->>> print_requests.py --get //postgres/catalogs
        -POST /api/2.0/postgres/catalogs
        -GET /api/2.0/postgres/catalogs/lakebase_test
        +Exit code: 1

latest (v1.27.0): same output as main (ab7c938)

TestAccept/bundle/resources/postgres_catalogs/create_transient_500/DMS=true: branch ✅ | main (ab7c938) ❌ | latest (v1.27.0) ❌

main (ab7c938):

acceptance_test.go:1388: Diff:
        --- bundle/resources/postgres_catalogs/create_transient_500/output.txt
        +++ /tmp/TestAcceptbundleresourcespostgres_catalogscreate_transient_52081228248/002/output.txt
        @@ -3,37 +3,7 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created postgres_catalogs.my_catalog
         Created postgres_projects.my_project
        -Files: 0 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        ->>> print_requests.py --get //postgres/catalogs
        -POST /api/2.0/postgres/catalogs
        -GET /api/2.0/postgres/catalogs/lakebase_test
        -
        -=== The create request times out and the catalog was not created: deploy repeats the create
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created postgres_projects.my_project
        -Warn: deploying resources.postgres_catalogs.my_catalog: retrying after 504 Gateway Timeout from POST /api/2.0/postgres/catalogs
        -Created postgres_catalogs.my_catalog
        -Files: 0 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        ->>> print_requests.py --get //postgres/catalogs
        -POST /api/2.0/postgres/catalogs
        -GET /api/2.0/postgres/catalogs/lakebase_test
        -POST /api/2.0/postgres/catalogs
        -GET /api/2.0/postgres/catalogs/lakebase_test/operations/[UUID]
        -
        -=== The catalog cannot be read after the create request fails: deploy fails with the create error
        -
        ->>> musterr [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
        -Created postgres_projects.my_project
        -Warn: deploying resources.postgres_catalogs.my_catalog: checking whether catalogs/lakebase_test was created: Fault injected by test.
         Error: cannot create resources.postgres_catalogs.my_catalog: Fault injected by test. (500 INTERNAL_ERROR)
         
         Endpoint: POST [DATABRICKS_URL]/api/2.0/postgres/catalogs?catalog_id=lakebase_test
        @@ -43,6 +12,4 @@
         
         Files: 0 uploaded, 0 deleted
         
        ->>> print_requests.py --get //postgres/catalogs
        -POST /api/2.0/postgres/catalogs
        -GET /api/2.0/postgres/catalogs/lakebase_test
        +Exit code: 1

latest (v1.27.0): same output as main (ab7c938)

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: a2d3ad0

Run: 44517417407

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 3 282 23 15:30
💚​ aws-windows-latest-4core-16gb 3 284 21 9:09
💚​ azure linux-2core-8gb 3 281 23 11:19
💚​ azure-windows-latest-4core-16gb 3 283 21 8:32
💚​ gcp linux-2core-8gb 3 279 24 14:46
💚​ gcp-windows-latest-4core-16gb 3 281 22 12:45
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/postgres_synced_tables/basic 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/postgres_synced_tables/basic/DMS= 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 13 slowest tests (at least 2 minutes):
duration env testname
3:47 gcp-windows-latest-4core-16gb TestAccept
3:26 aws linux-2core-8gb TestFilerRecursiveDelete/workspace_files_extensions
3:08 aws-windows-latest-4core-16gb TestAccept
2:49 azure-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
2:48 azure-windows-latest-4core-16gb TestAccept
2:39 aws linux-2core-8gb TestExportDir
2:29 aws linux-2core-8gb TestLock
2:23 azure-windows-latest-4core-16gb TestAccept/bundle/resources/postgres_catalogs/recreate/DMS=true
2:16 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/postgres_catalogs/recreate/DMS=
2:13 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsStat
2:06 azure linux-2core-8gb TestFilerRecursiveDelete/workspace_files
2:00 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/postgres_catalogs/recreate/DMS=true
2:00 gcp-windows-latest-4core-16gb TestImportDirWithOverwriteFlag

@denik
denik marked this pull request as ready for review November 19, 2026 12:19
@denik
denik requested review from a team as code owners November 19, 2026 12:19

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me — no issues found.

@denik
denik added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit b2c0257 Nov 19, 2026
30 checks passed
@denik
denik deleted the denik/lakebase-catalog-create-recovery branch November 19, 2026 12:47
@denik denik added factory-generated and removed ai-auto Deprecated: use factory-generated instead. labels Nov 20, 2026
deco-sdk-tagging Bot added a commit that referenced this pull request Nov 24, 2026
## Release v1.28.0

### CLI

 * Retry transient errors in `fs` commands: `fs cp` to a UC Volume from another Volume or DBFS (files up to 8 MiB) on HTTP 503, DBFS uploads when the upload stream is lost, and stat, read and list on UC Volumes on HTTP 500. ([#7607](#7607), [#7763](#7763), [#7839](#7839))
 * `databricks auth profiles --skip-validate` now omits the `Valid` column instead of reporting `NO` for every profile. ([#7638](#7638))
 * Fix Ctrl-C taking about 10 seconds to stop `databricks aitools install`, `update` or `uninstall` while it runs a coding agent's CLI, and retry reading an agent's config on Windows while the agent rewrites it. ([#7832](#7832), [#7870](#7870))
 * Automatic installation of Databricks AI tools no longer asks in containers or installs for the first time without a terminal, no longer runs as root in another user's home, keeps newer skills you installed, no longer hints to install what it is about to install, and on Linux and macOS stops the calling script on Ctrl-C. ([#7828](#7828), [#7834](#7834), [#7874](#7874), [#7888](#7888), [#7890](#7890), [#7901](#7901))
 * Wait before retrying a failed automatic install of Databricks AI tools, starting at 5 minutes and doubling after each failure, so a skills source or coding agent CLI that stays broken no longer slows down each of the next commands. ([#7900](#7900))
 * `databricks aitools install` now cancels the agent picker on Esc. ([#7721](#7721))
 * `databricks aitools uninstall --skills` now fails when its value names no skill instead of removing every skill, and `aitools update` and `uninstall` no longer prompt when a coding agent runs them; with skills in both scopes they fail and ask for `--scope`. ([#7873](#7873))
 * `databricks aitools install --skills-only` and `databricks aitools update` no longer mix skill files with the Databricks plugin: install skips agents that already have the plugin, and update no longer replaces skill files from a `--skills-only` install made with this release or later while the agent's CLI was on PATH. To keep skill files from an earlier `--skills-only` install, run `databricks aitools install --skills-only` again with the agent's CLI on PATH. ([#7831](#7831), [#7903](#7903))
 * `apps init` no longer suggests installing skills to Codex and Copilot users who installed the Databricks plugin with `databricks aitools install`. ([#7830](#7830))
 * Fix `databricks auth login` failing with `data passed to Set was too big` on macOS and Windows for OAuth tokens too large for one keyring item. ([#7845](#7845))
 * Fix the token storage mode (`auth_storage`) being read from the file named by `DATABRICKS_CONFIG_FILE` instead of the config file the profile was loaded from. ([#7733](#7733))
 * `databricks auth login` no longer waits for the browser that the default opener starts to close before it continues. ([#7551](#7551))
 * Allow `databricks auth docker configure` when several profiles match one workspace; the chosen profile is recorded for the registry and shown by `databricks auth docker host`. ([#7383](#7383))
 * Show the HTTP status, error code and endpoint when an API error has no message, instead of a bare `Error: `, and the HTTP status and path for Files API errors that used to show an empty `databricks-api error:`. ([#7800](#7800), [#7839](#7839))
 * AI agents can now submit feedback without confirmation; `--yes`/`-y` is deprecated, and agents passing `--yes=false` now get an error. ([#7795](#7795))
 * Log `/.well-known/databricks-config` fetch failures with a transient HTTP status (408, 429, or 5xx other than 501) at debug level instead of as a warning, like timeouts. ([#7912](#7912))
 * Fix interactive list output sometimes dropping or reordering a page of rows. ([#7804](#7804), [#7914](#7914))
 * Allow `databricks sandbox forward` to forward remote ports below 10000. The sandbox refuses a few reserved platform ports with an error that names the port. ([#7861](#7861))
 * Breaking: `databricks sandbox ssh` now uses local SSH keys and works with sandboxes created through the SDK or API; it no longer accepts `--port` and needs Python 3 and `openssh-server` in the sandbox. Add `databricks sandbox ssh-setup` to configure native SSH and SCP. ([#7588](#7588), [#7589](#7589), [#7590](#7590))
 * `databricks ssh connect` to serverless CPU compute now defaults to environment version 5, so the first connection after upgrading starts a new server; pass `--environment-version 4` to keep the old one. ([#7847](#7847))
 * `databricks ssh connect` now downloads the SSH server binaries from PyPI when GitHub is unreachable, using `PIP_INDEX_URL` or `index-url` from the per-user pip config over HTTPS only, and checks SHA-256 digests. ([#7852](#7852))

### AI Runtime

 * Breaking: `compute.pool_id` is no longer accepted in AIR workload YAML; use `compute.accelerator_pool_id`. ([#7698](#7698))
 * `databricks air convert-to-dabs` handles an existing output directory better: it gives the right guidance when the directory already holds the workload's bundle, `--force` no longer replaces a different bundle or an alternate root file, re-converting removes stale sidecars, and git-pinned code outside the bundle gets an `--output-dir` suggestion. ([#7835](#7835), [#7853](#7853), [#7857](#7857), [#7866](#7866))
 * `air list` and `air get` now find the AI Runtime task anywhere in a multi-task job; a job with several such tasks lists one row per task (so `run_id` is no longer unique in `air list -o json`), and both report `task_key` (`air get --task-key` selects one). `air list --all-status` now orders runs by submission time instead of by their latest attempt's start. ([#7632](#7632))
 * Update fallback messages for pending AI Runtime runs when AIR does not report a status reason. ([#7899](#7899))
 * `air run -o json` now reports config-validation errors as a JSON error envelope, with `UNAUTHENTICATED`, `INVALID_ARGS` or the new `PERMISSION_DENIED` code. ([#7864](#7864))

### Bundles

 * Bundle commands no longer hang after a request timeout on a dead HTTP/2 connection. ([#7723](#7723))
 * Fix a panic when the local Terraform state is removed after it is pulled and before it is migrated to the direct engine, for example by a concurrent `bundle deploy`. ([#7778](#7778))
 * The direct deployment engine now uses a Lakebase or postgres catalog that a failed create request still created, instead of failing the deploy. ([#7801](#7801))
 * `bundle deploy` and `bundle run` for apps now succeed when the app's compute is already active or starting, and deploy the app when the deployment triggered by start failed. ([#7709](#7709), [#7780](#7780))
 * Add `thumbnail_path` to the `apps` resource, so `bundle deploy` sets, updates and deletes the thumbnail shown for the app in the Apps UI. ([#7728](#7728))
 * Fix bundle commands failing on a notebook or file path with a colon in its first segment, such as the default workspace notebook name `New Notebook 2026-10-28 12:17:43.ipynb`. ([#7851](#7851))
 * `bundle run` and `pipelines run` now retry transient errors from the pipeline events and update status reads while waiting for an update. ([#7800](#7800))

### Dependency Updates

 * Bump dependencies with known vulnerabilities. ([#7904](#7904))
 * Update the Go SDK to [v0.203.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.203.0). ([#7869](#7869), [#7906](#7906))
 * Update `github.com/databricks/sdk-go/files` to [v0.9.0](https://github.com/databricks/sdk-go/blob/files/v0.9.0/files/CHANGELOG.md). ([#7889](#7889))
apeforest pushed a commit to apeforest/cli that referenced this pull request Nov 25, 2026
…abricks#7910)

## Changes

A create request that times out or gets a 5xx may still have been
applied by the backend. Repeating it then fails with "already exists",
and every later deploy fails the same way. Seven recent PRs taught one
resource at a time to recover from this
([databricks#7602](databricks#7602),
[databricks#7747](databricks#7747),
[databricks#7757](databricks#7757),
[databricks#7767](databricks#7767),
[databricks#7782](databricks#7782),
[databricks#7801](databricks#7801), plus
[databricks#7599](databricks#7599) for vector search
endpoints). They used three implementations. This PR moves all of them
onto one helper, adds the helper to every resource that can support it,
and adds a test that fails when a resource has neither recovery nor a
documented opt-out.

### Design

`recoverCreate` in `bundle/direct/dresources/create_recovery.go` is now
the only implementation:

1. It returns the create error unchanged unless the error leaves the
outcome unknown: a transient error, 499 CANCELLED, or an HTTP/2 stream
reset.
2. It looks the resource up by the name the bundle chose.
3. If the resource is found, it uses it only if its create time is no
more than a minute before the first request. A resource with no create
time, or an older one, fails the deploy with the original error. For
Unity Catalog resources it also requires `created_by` to be the
deploying principal (`createdByCaller`). That way a resource that
belongs to someone else is never taken over.
4. If the resource is missing, it pauses and repeats the request, up to
`retry.MaxRetries` times. A repeat that fails with "already exists"
means an earlier request landed in the meantime, so the next lookup
finds it. Each resource says how its API reports a taken name:
`isAlreadyExists` (error codes ALREADY_EXISTS, RESOURCE_ALREADY_EXISTS,
CATALOG_ALREADY_EXISTS, SCHEMA_ALREADY_EXISTS; the Unity Catalog codes
were checked on AWS), or `isPostgresAlreadyExists` for the Lakebase
projects, branches, roles and catalogs that already used it, which also
matches the 400 that projects return.

`createRecovery[T, R]` has two optional extension points that the
Lakebase resources need. `use` turns a found resource into DoCreate's
result, for example by waiting for a branch to become READY. `create`
returns a `finish` step that waits for the create operation, and errors
from that step are not treated as a failed create request. `useFound`
and `repeatCreate` fill both in for the common case.

Resources whose create is idempotent keep the existing `retrySafe(err)`
route. There, `DeploymentUnit.Create` repeats the request. Its retry
rule is now `dresources.IsRetrySafe`, so the test runs DoCreate with the
same rule the deploy uses. `IsRetrySafe` repeats on the same uncertain
errors as `recoverCreate`, so 499 and stream resets are now also
repeated for permissions, grants and Lakebase creates with
`replace_existing`.

`TestCreateRecoveryCoverage` (`create_recovery_coverage_test.go`) covers
every entry in `SupportedResources`:
- It runs DoCreate once against the test server to find the create
request. That is the first mutating request; if DoCreate sends it more
than once, as dashboards do after creating their folder, the test uses
the last send.
- It then fails that request with a 504 through an HTTP transport, in
two variants: after the server applied it, and before.
- It runs DoCreate the way the deploy does, including the `retrySafe`
repeat. It also checks that the failed request is the create request
from the first run (method and path, with ids masked).
- Every resource must succeed in both variants. In the applied variant,
a resource that does not use `retrySafe` must not send the create
request again, because for a backend-assigned id that would make a
duplicate.
- A resource that cannot recover goes in `createRecoveryOptOut` with the
reason. A listed resource must fail with the injected 504. If it starts
recovering, or fails for another reason, the test fails, so the list
cannot go stale.

`prepareTestState` is moved out of `testCRUD` unchanged, so both tests
build the same fixtures.

### Per-resource table

| Resource | Recovery | Since |
|---|---|---|
| features, dashboards, model_serving_endpoints, model_services,
mcp_services, model_provider_services, database_catalogs |
`recoverCreate` (lookup by name or path) | earlier PRs |
| postgres_projects, postgres_branches, postgres_roles,
postgres_catalogs | `recoverCreate`, previously `recoverPostgresCreate`;
branches and roles with `replace_existing` use `retrySafe` | earlier
PRs, moved here |
| vector_search_endpoints | `recoverCreate`, previously its own retry
loop | [databricks#7599](databricks#7599), moved here
|
| postgres_endpoints, postgres_databases | `recoverCreate`; with
`replace_existing`, `retrySafe` | this PR |
| postgres_synced_tables | `recoverCreate` | this PR |
| catalogs (the create request; not the follow-up isolation_mode
update), schemas, volumes, external_locations, registered_models,
secrets | `recoverCreate` (Unity Catalog full name, `created_at` /
`create_time`) | this PR |
| postgres_snapshot_schedules, secret_scopes.permissions | `retrySafe`
(setting the desired value again is safe) | this PR |
| *.permissions, *.grants | `retrySafe` | earlier |
| jobs, pipelines, clusters, sql_warehouses, instance_pools, alerts,
genie_spaces | opt-out: the backend assigns the id, and the create
request takes no idempotency token | |
| feature_specs, secret_scopes, quality_monitors, data_quality_monitors,
vector_search_indexes, synced_database_tables | opt-out: the read
response has no create time, so a found resource could predate the
deploy | |
| internal_immutable_snapshots | opt-out: immutable upload; not known
whether a second upload to the same path is accepted | |
| job_runs, materialization_sets | opt-out, candidate: repeat with the
same idempotency token / request_id (DoCreate mints a new one per
request today) | |
| cluster_policies, apps, database_instances, experiments, models,
postgres_data_apis | opt-out, candidate: unique name and a create time
exist, but each needs its own work (lookup by name for a backend id, the
app DELETING path, test server support, a Data API's spec that comes
from a status that can still be empty) | |

The reasons are spelled out in `createRecoveryOptOut`.

### Behavior changes for resources that already recovered

- Lakebase projects, branches, roles and catalogs now also recover from
499 CANCELLED and HTTP/2 stream resets, as the other resources already
did. The lookup is also retried on those errors.
- Lakebase resources now also treat 409 RESOURCE_ALREADY_EXISTS and 400
CATALOG_ALREADY_EXISTS on a repeated request as "already exists". The
other resources match exactly what they matched before. A repeated
request that fails this way is always followed by another lookup and the
create-time check.
- A Lakebase resource found without a create time now fails with "exists
but has no create time, so it is not known to be created by this
deployment" instead of "was not created by this deployment".
- Vector search endpoints now look the endpoint up before repeating the
request, instead of repeating it and handling ALREADY_EXISTS. The
outcome is the same with one request fewer. The "was created by an
earlier attempt" warning becomes the shared Info log.
- The lookup-failure warning now names the resource type, e.g. "checking
whether project projects/x was created". That is the only change in the
four Lakebase goldens.

### Known limits

- A recovered Lakebase synced table or database is used as soon as the
lookup finds it. The success path waits for the create operation, but
recovery has no operation to wait on. Recovered Lakebase catalogs and
roles already work this way. Endpoints still wait for reconciliation; if
that wait ends early, the endpoint is kept with a warning, as branches
and projects are.
- Each covered DoCreate wires its own `recoverCreate` call. Moving
recovery into the framework, with an optional adapter method for the
lookup, would cut the per-resource code. It would also change the
adapter interface, so I left it for a separate change. The coverage test
already catches a resource that forgets the call.

## Why

The same class of failure kept coming back one resource at a time.
Recent main failures this PR fixes:

| Error | Verbatim |
|---|---|
|
[error/3328](http://go/cli/dashboard/error/3328?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d)
| `Error: cannot create resources.postgres_synced_tables.my_table: (504
DEADLINE_EXCEEDED)` |
|
[error/537](http://go/cli/dashboard/error/537?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d)
| `Error: cannot create resources.postgres_synced_tables.my_table: The
request could not be processed. Please try again later and contact
Databricks if the problem persists. [TraceId: [TRACE_ID]] (500
INTERNAL_ERROR)` |
|
[error/3801](http://go/cli/dashboard/error/3801?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d)
| `Error: cannot create resources.schemas.schema1: Post
"[DATABRICKS_URL]/api/2.1/unity-catalog/schemas": unexpected EOF (500
UNKNOWN)` |

Dashboard:
-
[error/3328](http://go/cli/dashboard/error/3328?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d):
[TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d),
[TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=true](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=true?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d)
-
[error/537](http://go/cli/dashboard/error/537?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d):
[TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS=](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS=?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d),
[TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS=true](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS=true?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d)
-
[error/3801](http://go/cli/dashboard/error/3801?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d):
[TestAccept/bundle/resources/grants/volume_change_name/DMS=](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/grants/volume_change_name/DMS=?main=1&pr=1&end=2026-11-24T10:00:00Z&last=14d)

## Tests

- `TestCreateRecoveryCoverage` covers all 72 registry keys. To check
that it catches gaps, I disabled schema recovery and then removed the
jobs opt-out; the test failed for each with the "call recoverCreate ...
or add it to createRecoveryOptOut" message.
- `TestSchemaCreateRecoveryRejectsSchemaOfAnotherUser` and
`TestSchemaCreateRecoveryLooksAgainAfterSchemaAlreadyExists` cover the
creator check and a repeat that loses to the first request.
- The existing unit tests for features, dashboards, database catalogs
and the Lakebase resources pass unchanged. I added
`TestCreateRecoveryAllowsClockSkew` to replace the vector search
`createdSince` test, which tested a function this PR removes.
- `go test ./acceptance -run TestAccept/bundle` passes. Golden changes:
the Lakebase warning wording, and the vector search create-504 request
sequence.

Decisions:
- I kept experiments and models as candidates rather than adding them
here. libs/testserver would need `get-by-name` and creation timestamps,
and those timestamps would show up in many unrelated goldens.
- New DoCreate code uses the `create := func(ctx)` pattern of the
resources that already recovered, so that the create call can be handed
to `recoverCreate` and repeated.
- I left jobs and pipelines as opt-outs. Without an idempotency token, a
repeated create cannot tell its own resource from a duplicate.

This pull request and its description were written by Isaac.

---------

Co-authored-by: Isaac <no-reply@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues factory-generated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants