Skip to content

Log hostmetadata fetch failures with a transient HTTP status at debug - #7912

Merged
denik merged 2 commits into
mainfrom
hostmetadata-transient-status
Nov 24, 2026
Merged

denik merged 2 commits into
mainfrom
hostmetadata-transient-status

Conversation

@denik

@denik denik commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

#7752 stopped SDK inactivity timeouts of /.well-known/databricks-config from printing a warning. Cloud acceptance tests on main still fail now and then because bundle deploy prints an extra line:

+Warn: [hostmetadata] failed to fetch host metadata for [DATABRICKS_URL], will skip for 1m0s

In cloud runs the CLI talks to the local test proxy (libs/testproxy), which turns an upstream failure into an HTTP status (the upstream 5xx, or a 500 when its own upstream call fails). The SDK's refresh client doesn't retry 5xx, and it reports the status as an apierr sentinel (500/503/504/429) or as an httpclient.HttpError (e.g. 502). The timeout check from #7752 misses both, so the resolver logs a Warn. In the newest gcp failure the same command also had GET /api/2.0/preview/scim/v2/Me answered with a transient error, so the workspace was briefly unhealthy.

Changes

  • libs/hostmetadata: a fetch failure with a transient HTTP status (408, 429, 5xx except 501) is logged at Debug, like the timeout. It is still negatively cached for 60s, and the SDK falls back to the user config as before.
  • Other failures keep the Warn: 4xx (e.g. 404) and network errors such as DNS or TLS failures (the goldens under acceptance/cmd/auth show the DNS case).

Decision: the Debug level also applies outside tests, e.g. a corporate gateway that always answers this one endpoint with 502. Commands still work there because the SDK falls back to the user config, and the gateway's failures on real API calls stay visible. A Warn for a single 5xx changes the output of every command while it is cached and points users to a problem they can't fix. The 60s negative cache is unchanged, the same as for timeouts in #7752. I didn't reuse `libs/retry.IsTransient`: it works on `apierr.APIError` from the main client and leaves out what the SDK already retried, while this fetch goes through the SDK's refresh client, which returns `apierr` sentinels or `httpclient.HttpError`.

Tests

  • New unit tests run the SDK's real fetch against an httptest server: 408/429/500/502/503/504 log at Debug and are negatively cached; 404 and 501 still warn. The transient test fails without the fix.
  • go test ./libs/hostmetadata and the local acceptance tests under cmd/auth, cmd/api, bundle/deploy/empty-bundle and bundle/resources/schemas pass.

Dashboard

error snippet
error/1418 Warn: [hostmetadata] failed to fetch host metadata for [DATABRICKS_URL], will skip for 1m0s

Failures after #7752 merged:

This pull request and its description were written by Isaac.

#7752 moved the SDK inactivity timeout to Debug, but a 5xx or 429 from
/.well-known/databricks-config still printed
"Warn: [hostmetadata] failed to fetch host metadata ..." and changed the
output of unrelated cloud acceptance tests (in cloud runs the test proxy
reports any upstream failure as an HTTP status). Such a failure says
nothing about the host's config and the SDK falls back to the user config,
so log it at Debug too; it stays negatively cached. 4xx (other than 408/429)
and network errors keep the Warn.

Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 5ac0808

Run: 45380639991

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 272 19 8:37
💚​ aws-windows-latest-4core-16gb 1 274 17 6:25
💚​ azure linux-2core-8gb 1 271 19 9:58
💚​ azure-windows-latest-4core-16gb 1 273 17 6:34
💚​ gcp linux-2core-8gb 1 272 19 8:28
💚​ gcp-windows-latest-4core-16gb 1 274 17 6:04
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
Top 8 slowest tests (at least 2 minutes):
duration env testname
4:04 azure linux-2core-8gb TestAccept
3:59 aws linux-2core-8gb TestAccept
3:31 gcp-windows-latest-4core-16gb TestAccept
3:24 azure-windows-latest-4core-16gb TestAccept
3:21 gcp linux-2core-8gb TestAccept
2:55 aws-windows-latest-4core-16gb TestAccept
2:24 aws-windows-latest-4core-16gb TestTelemetryEndpoint
2:05 gcp-windows-latest-4core-16gb TestTelemetryEndpoint

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik marked this pull request as ready for review November 24, 2026 11:22
@denik
denik requested a review from a team as a code owner November 24, 2026 11:22

@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.

Automated review at 5ac0808. Each finding was verified against the code.

No blocking issues found. 2 non-blocking comment(s) and 1 question(s) below.

This PR changes the hostmetadata resolver so that a failed /.well-known/databricks-config fetch with a transient HTTP status (408, 429, or any 5xx except 501) is logged at Debug instead of Warn. That is the same treatment #7752 gave SDK inactivity timeouts. The classification logic is correct, and the unit tests run the SDK's real fetch path for each status. My comments cover the doc comment on the new helper, which should say how it differs from retry.IsTransient, and one comment line that needs re-wrapping.

Questions

  1. The new isTransientHTTPError and its copy of the inactivity-timeout check sit next to libs/retry.IsTransient and isInactivityTimeout, which do a similar job with a different status set and error types. Should the shared parts (inactivity timeout, 5xx/408) move into one helper in libs/retry that both call, or are they meant to stay separate and just be documented as different? (non-blocking)

Comments outside the changed lines

  • [nit] libs/hostmetadata/resolver.go:39: This line of the rewritten comment is much longer than the lines around it. Can you re-wrap the block so all its lines have a similar width?

// that a later attempt may not repeat: 408, 429 or 5xx other than 501. The
// SDK's refresh client unwraps statuses it knows to an apierr sentinel and
// leaves others (e.g. 502) as an [httpclient.HttpError].
func isTransientHTTPError(err error) bool {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nice to have] This is a second list of transient statuses next to retry.IsTransient in libs/retry/retry.go, and the two disagree. IsTransient counts a 501 as transient (StatusCode >= 500) and does not count 429. This helper does the opposite on both. The PR description explains why IsTransient isn't reused: it works on a different error type and skips statuses the SDK already retried. The doc comment doesn't explain any of that, so the next person to touch either function is likely to "fix" one to match the other. Can you add a sentence pointing at retry.IsTransient that names the differences and why they exist? For example: "a 501 means the host doesn't serve the endpoint, which is a lasting answer about the host, so it keeps the Warn".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Kept separate on purpose: retry.IsTransient classifies apierr.APIError from the main client and leaves out what the SDK already retried, while this fetch goes through the SDK refresh client, which returns apierr sentinels or httpclient.HttpError. 501 keeps the Warn because it is a lasting answer about the host; 429 is included because the refresh client gives up on it after its retry timeout. Happy to add this to the doc comment in a follow-up; not pushing now to keep the approved head. AI agent (opus5.5, isaac_claude)

@denik
denik added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 07bdfe6 Nov 24, 2026
30 checks passed
@denik
denik deleted the hostmetadata-transient-status branch November 24, 2026 13:05
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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants