Repository navigation
Suggest auth logout command for duplicate Docker profiles - #7363
Merged
Merged
Conversation
When multiple profiles match the same workspace ID, the Docker credential helper error now tells users how to remove the duplicate profile. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
|
Commit: Regression test reportSelected 2 changed tests (limit=20, 0 not selected) 2 tests: regression=2 unreleased=0 coverage=0 failing=0
TestAccept/cmd/auth/docker/configure-errors: branch ✅ | main (964664a) ❌ | latest (v1.24.0) ❌main (964664a): latest (v1.24.0): same output as main (964664a) TestAccept/cmd/auth/docker/token: branch ✅ | main (964664a) ❌ | latest (v1.24.0) ❌main (964664a): latest (v1.24.0): same output as main (964664a) |
Collaborator
Integration test reportCommit: 0492d50
Top 3 slowest tests (at least 2 minutes):
|
yolocs
approved these changes
Nov 4, 2026
Collaborator
Integration test reportCommit: a411008
21 interesting tests: 11 FAIL, 10 flaky
Top 50 slowest tests (at least 2 minutes):
|
deco-sdk-tagging Bot
added a commit
that referenced
this pull request
Nov 9, 2026
## Release v1.25.0 ### CLI * `databricks aitools install --output json` now reports a more specific `error_category` (`MANIFEST_NOT_FOUND`, `PERMISSION_DENIED`, `FILESYSTEM`) for some failures it reported as `UNCATEGORIZED`. ([#7380](#7380)) * Suggest `databricks auth logout --profile <profile-name> --delete` when multiple profiles match the same workspace in `databricks auth docker` commands. ([#7363](#7363)) * Fix `%pip` in Jupyter notebooks opened over `databricks ssh connect` on serverless environment versions 5 and 6 and on dedicated clusters running recent Databricks Runtime versions, which fell back to the stock IPython magic instead of the Databricks one. ([#7263](#7263)) ### AI Runtime * `databricks air run` now validates the config server-side while it uploads the run artifacts, instead of before, which shortens submission. ([#7368](#7368)) * Remove `CRITICAL` as a valid `compute.priority_class` value; the AI Runtime API no longer accepts it. ([#7371](#7371)) ### Bundles * Built-in templates add the workspace ID to `workspace.host` (`?w=<id>`) when the profile or an environment variable sets it, so generated bundles select the right workspace on hosts shared by several workspaces. Welcome messages show the same URL, and `dbt-sql` also adds `?o=<id>` to the HTTP path it suggests for `dbt init`. ([#7350](#7350)) * Fix grants of a renamed or recreated catalog, schema, volume or other UC resource staying recorded under the old name, which made the next `bundle plan` propose to apply them again. ([#7345](#7345)) * Fix permissions of a recreated pipeline, app, dashboard, model serving endpoint or other resource staying recorded under the old ID, which made every later `bundle plan` propose to apply them again. ([#7361](#7361)) * Add the `postgres_data_apis` resource (Private Preview) for enabling and configuring the Data API of a Lakebase Postgres database. ([#7160](#7160)) * Fixes [#4012](#4012): registered model `aliases` are now set in Unity Catalog on deploy instead of being silently ignored. A model without an `aliases` section keeps the aliases set outside the bundle (for example by MLflow), and `aliases: []` removes them. ([#7163](#7163)) * Include variable declarations and the source of each resolved value in the `--include-locations` output of `bundle validate` and `bundle summary`. ([#7351](#7351)) * Add `.workspace.URLID` to bundle templates: the workspace ID that `.workspace.URL` adds, or empty, so templates can use it without failing when the ID is unknown. ([#7388](#7388)) * Expose the workspace of the selected profile to bundle templates as `.workspace`, with `Hostname`, `ID`, and `URL`, so templates can address a workspace on a host shared by several workspaces. A template input named `workspace` takes precedence. ([#7349](#7349)) ### Dependency Updates * Bump dependencies with known vulnerabilities. ([#7394](#7394)) * Upgrade `github.com/mattn/go-runewidth` to v0.0.31, which removes ~30ms of startup time from every command. ([#7391](#7391)) * Update the Go SDK to [v0.194.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.194.0). ([#7371](#7371)) * Update the Go SDK to [v0.195.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.195.0). ([#7384](#7384))
This was referenced Nov 9, 2026
idelafuente-oc
pushed a commit
to idelafuente-oc/cli
that referenced
this pull request
Nov 20, 2026
…ks#7383) ## Changes `databricks auth docker configure <profile>` no longer fails when several profiles match the selected workspace. It records the chosen profile for the registry in the `[__settings__]` section of `.databrickscfg`, next to `default_profile`, and leaves profile sections untouched: ```ini [__settings__] docker_profile.1234567890123456.container.us-west-2.cloud.databricks.com = prod ``` Running it with another profile switches the selection: ``` Warning: Docker credential helper for 1234567890123456.container.us-west-2.cloud.databricks.com switched from profile dev to prod Configured Docker credential helper for 1234567890123456.container.us-west-2.cloud.databricks.com ``` `databricks auth docker token` (the Docker credential helper) picks the profile for a registry like this: - A recorded profile wins. If it is missing, no longer targets the registry's workspace, or is no longer supported, the helper fails instead of falling back to another identity. - With no recorded profile, a single supported match is used, as before. This covers setups configured with older CLI versions. - Otherwise it fails with `... Select the profile for Docker with: databricks auth docker configure <profile-name>`. `databricks auth docker host --profile P` shows the profile the helper uses for the registry (`Credential helper profile: prod`, and `profile` in JSON output). It reports the helper as configured only if Docker's `config.json` selects it for the registry, it is on `PATH`, and it would use `P`. `databricks auth logout --delete` removes entries that name the deleted profile, the same way it clears `default_profile`. The helper then falls back to the no-recorded-profile rules above. ## Why Docker gives the credential helper only the registry host, which encodes the workspace ID, so the helper cannot tell which of several matching profiles was meant. `auth login` now saves `workspace_id` on every profile, so two logins to one workspace were enough to block `auth docker configure`. Recording the choice at configure time means `docker push` uses the profile that was configured, whatever the order in `.databrickscfg`, and the helper never switches identity on its own. The choice is a CLI setting rather than part of a profile's identity, so it lives in `[__settings__]` like `default_profile`. Keying it by registry host keeps one entry per registry, and re-pointing a profile at another workspace cannot carry the choice with it. Being in `.databrickscfg`, it follows `DATABRICKS_CONFIG_FILE`. This replaces the "remove the duplicate profile" hint that databricks#7363 added in v1.25.0. Follow-up: matching compares only the workspace ID and loopback vs remote host, not the deployment's DNS zone, so a profile on another Databricks deployment with the same workspace ID also matches, whether or not it is recorded. ## Tests - Unit: `ProfileForRegistry` (recorded profile wins; missing, other-workspace and unsupported recorded profiles fail; no entry keeps the previous rules), `GetDockerProfile` and `SetDockerProfile` (new entry, switch, no-op without a write, other registries untouched and read as unset, `default_profile` kept), `ClearDockerProfiles` (clears only entries for the given profile, no write when nothing matches or the file is missing), and `Inspect` (Docker config, `PATH` and profile selection are all required, and the reported profile in each case). - Acceptance: `cmd/auth/docker/{configure,configure-errors,token,help}`. Configure switches to another profile and back, with `host` reporting the profile Docker uses and whether it matches, and prints the resulting `.databrickscfg`. `auth logout --delete` of the recorded profile clears its entry. A stale entry makes `host` report not configured and the helper fail. Token errors when several profiles match and none is recorded, and uses the recorded profile over an earlier logged-in one. - `go test ./cmd/... ./libs/dockercredentials/... ./libs/auth/... ./libs/databrickscfg/...` and `go test ./acceptance -run 'TestAccept/(cmd|air|auth)/'` pass, including `air/image-push`, which parses the `auth docker configure` output. Lint, deadcode, whitespace and changelog checks pass. This pull request and its description were written by Isaac. Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
When multiple profiles match the same workspace ID, the Docker credential helper error now tells users how to remove the duplicate:
Both call sites in
libs/dockercredentials/profile.gonow share one helper.Tests
Updated unit test expectations and the
auth/docker/tokenandauth/docker/configure-errorsacceptance outputs.This pull request and its description were written by Isaac.