Skip to content

Bound databricks-cli login timeout to fix indefinite WSL hang#1921

Open
rugpanov wants to merge 1 commit into
mainfrom
fix-wsl-databricks-cli-login-hang
Open

Bound databricks-cli login timeout to fix indefinite WSL hang#1921
rugpanov wants to merge 1 commit into
mainfrom
fix-wsl-databricks-cli-login-hang

Conversation

@rugpanov

Copy link
Copy Markdown
Contributor

Why

Fixes #1917.

With auth_type=databricks-cli, a stale/expired cached token makes the extension run databricks auth login, whose browser OAuth challenge defaults to a 1-hour timeout in the bundled CLI. In WSL the Linux CLI cannot open the Windows browser or receive the localhost callback, so the flow never completes and the extension appears to hang indefinitely on "Attempting to configure auth: databricks-cli" — with no feedback and no guidance.

This PR fixes the hang (the reported symptom). The underlying token-cache host/profile split-brain that triggers the re-login is separate CLI-side state; the broader direction there is profile-first token caching handled upstream in the Databricks CLI, and a one-time databricks auth login --profile <name> resolves it permanently in the meantime. See the issue thread for the full root-cause walkthrough.

What

  • Pass --timeout 300s to auth login so a non-completing browser flow fails fast (5 min is ample for a human login, far below the 1h default) instead of stalling.
  • On login failure, surface an actionable error telling the user to run databricks auth login --profile <p> (or --host <h>) in a terminal and reload, instead of only the raw CLI error.
  • Make the exec function injectable on DatabricksCliCheck so login argument-building and error handling are unit-testable without spawning the real CLI.

Verification

  • New DatabricksCliCheck.test.ts covers: bounded --timeout passed with a profile, --host used without a profile, and the actionable failure message.
  • tsc --noEmit clean; eslint and prettier clean on the changed files.

*Why*
With auth_type=databricks-cli, a stale/expired cached token makes the
extension run `databricks auth login`, whose browser OAuth challenge
defaults to a 1-hour timeout in the bundled CLI. In WSL the Linux CLI
cannot open the Windows browser or receive the localhost callback, so the
flow never completes and the extension appears to hang indefinitely on
"Attempting to configure auth: databricks-cli" (#1917). The user is left
with no feedback and no guidance.

*What*
- Pass `--timeout 300s` to `auth login` so a non-completing browser flow
  fails fast (5 min is ample for a human login, far below the 1h default).
- On login failure, surface an actionable error telling the user to run
  `databricks auth login --profile <p>` (or `--host <h>`) in a terminal
  and reload, instead of only the raw CLI error.
- Make the exec function injectable on DatabricksCliCheck so login
  argument-building and error handling are unit-testable without spawning
  the real CLI.

This is the pragmatic fix for the reported symptom (the hang). The
underlying token-cache host/profile split-brain is a separate CLI-side
issue tracked upstream; it is not required to stop the hang.

*Verification*
- New DatabricksCliCheck.test.ts covers: bounded --timeout passed with a
  profile, --host used without a profile, and the actionable failure
  message.
- tsc --noEmit clean; eslint and prettier clean on the changed files.
- (The repo's VS Code mocha harness cannot run under this env's Node 26
  due to an unrelated transitive dep; behavior was verified against the
  compiled output with the SDK/vscode modules stubbed.)
@rugpanov rugpanov deployed to test-trigger-is June 19, 2026 14:43 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/vscode

Inputs:

  • PR number: 1921
  • Commit SHA: cc1f5f910f4129a7f3aa20b5ddb128dd75504cf0

Checks will be approved automatically on success.

@rugpanov

rugpanov commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

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.

Stuck on login when working in WSL and using auth_type=databricks-cli

1 participant