From f36a2f510e9dc1aba5d50f0d85ccb309afbeeee2 Mon Sep 17 00:00:00 2001 From: Maksim Zuev Date: Fri, 30 Oct 2026 15:11:32 +0000 Subject: [PATCH 1/3] Apply the timeout to the auth token inline login PersistentAuth.Challenge uses the context passed to NewPersistentAuth, but the timeout context was created after it, so the one hour timeout never applied. Closing the browser tab left auth token waiting until Ctrl+C. Create the timeout context first, as auth login does. Co-authored-by: Isaac --- cmd/auth/token.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/auth/token.go b/cmd/auth/token.go index e7c004d7b4c..bbde8dc5eff 100644 --- a/cmd/auth/token.go +++ b/cmd/auth/token.go @@ -452,15 +452,18 @@ func runInlineLogin(ctx context.Context, profiler profile.Profiler, tokenStore s u2m.WithOAuthArgument(oauthArgument), u2m.WithBrowser(func(url string) error { return browser.Open(ctx, url) }), } + + // Challenge uses the context passed to NewPersistentAuth, so the timeout + // must be set before it. + ctx, cancel := context.WithTimeout(ctx, defaultTimeout) + defer cancel() + persistentAuth, err := u2m.NewPersistentAuth(ctx, persistentAuthOpts...) if err != nil { return "", nil, err } defer persistentAuth.Close() - ctx, cancel := context.WithTimeout(ctx, defaultTimeout) - defer cancel() - token, err := persistentAuth.Challenge() if err != nil { return "", nil, err From c0321c9db6d7b982edd72866ae25e751e019485d Mon Sep 17 00:00:00 2001 From: Maksim Zuev Date: Fri, 30 Oct 2026 15:48:20 +0000 Subject: [PATCH 2/3] Add a changelog fragment for the auth token timeout fix Co-authored-by: Isaac --- .nextchanges/cli/auth-token-inline-login-timeout.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nextchanges/cli/auth-token-inline-login-timeout.md diff --git a/.nextchanges/cli/auth-token-inline-login-timeout.md b/.nextchanges/cli/auth-token-inline-login-timeout.md new file mode 100644 index 00000000000..a36ff1419f2 --- /dev/null +++ b/.nextchanges/cli/auth-token-inline-login-timeout.md @@ -0,0 +1 @@ +* Fix `databricks auth token` waiting indefinitely during inline login instead of timing out after one hour. ([#7267](https://github.com/databricks/cli/pull/7267)) From dc28d3e96ead72f40336ef64a3bc696427d026b7 Mon Sep 17 00:00:00 2001 From: Maksim Zuev Date: Fri, 30 Oct 2026 15:53:01 +0000 Subject: [PATCH 3/3] Drop the changelog fragment for the auth token timeout fix Co-authored-by: Isaac --- .nextchanges/cli/auth-token-inline-login-timeout.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .nextchanges/cli/auth-token-inline-login-timeout.md diff --git a/.nextchanges/cli/auth-token-inline-login-timeout.md b/.nextchanges/cli/auth-token-inline-login-timeout.md deleted file mode 100644 index a36ff1419f2..00000000000 --- a/.nextchanges/cli/auth-token-inline-login-timeout.md +++ /dev/null @@ -1 +0,0 @@ -* Fix `databricks auth token` waiting indefinitely during inline login instead of timing out after one hour. ([#7267](https://github.com/databricks/cli/pull/7267))