Skip to content

Fix auth token error code - #6731

Merged
simonfaltum merged 5 commits into
mainfrom
fix-auth-token-error-code
Sep 18, 2026
Merged

simonfaltum merged 5 commits into
mainfrom
fix-auth-token-error-code

Conversation

@simonfaltum

@simonfaltum simonfaltum commented Sep 17, 2026

Copy link
Copy Markdown
Member

Changes

Use the standard UNAUTHENTICATED Databricks error code when databricks auth token --output json can't refresh a cached U2M token.

Example:

{
  "error_code": "UNAUTHENTICATED",
  "message": "A new access token could not be retrieved because the refresh token is invalid. To reauthenticate, run the following command:\n  $ databricks auth login --profile test-profile"
}

Why

#6684 introduced INVALID_REFRESH_TOKEN as an ad-hoc top-level error code. Databricks error code guidelines require using a standard code, and UNAUTHENTICATED is the closest match for cached credentials that are no longer valid. The existing error message and reauthentication guidance remain unchanged.

Tests

  • go test ./cmd/auth ./libs/auth/...
  • go test ./acceptance -run 'TestAccept/cmd/auth/token/force-refresh-invalid-refresh-token$' -tail -test.v
  • ./task fmt
  • ./task checks
  • ./task lint
  • ./task test (the auth changes pass; the unrelated bundle/templates/lakeflow-integrations test fails because its offline uv cache is missing charset-normalizer and certifi)

This PR was written by Codex.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 19513c8

Run: 35321179545

Env ✅​pass 🙈​skip Time
✅​ aws linux 276 16 6:44
✅​ aws windows 278 14 5:23
✅​ azure linux 275 16 4:51
✅​ azure windows 277 14 5:18
✅​ gcp linux 276 16 6:00
✅​ gcp windows 278 14 6:37
Top 3 slowest tests (at least 2 minutes):
duration env testname
5:25 gcp windows TestAccept
5:19 aws windows TestAccept
5:15 azure windows TestAccept

Comment thread .nextchanges/cli/auth-token-unauthenticated.md Outdated
Co-authored-by: Jan N Rose <janniklas.rose@gmail.com>
@simonfaltum
simonfaltum added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit bb668af Sep 18, 2026
33 checks passed
@simonfaltum
simonfaltum deleted the fix-auth-token-error-code branch September 18, 2026 15:31
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

Successfully merging this pull request may close these issues.

3 participants