Fix auth token error code - #6731
Merged
Merged
Conversation
Collaborator
Integration test reportCommit: 19513c8
Top 3 slowest tests (at least 2 minutes):
|
janniklasrose
approved these changes
Sep 18, 2026
Co-authored-by: Jan N Rose <janniklas.rose@gmail.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
Use the standard
UNAUTHENTICATEDDatabricks error code whendatabricks auth token --output jsoncan'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_TOKENas an ad-hoc top-level error code. Databricks error code guidelines require using a standard code, andUNAUTHENTICATEDis 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 unrelatedbundle/templates/lakeflow-integrationstest fails because its offline uv cache is missingcharset-normalizerandcertifi)This PR was written by Codex.