databricks/databricks-vscode

[BUG] The extension does not respect the HOME environment variable correctly

geoffdavey opened this issue · 1 comments

Describe the bug

The extension does not respect the HOME environment variable correctly. If the user has set their HOME environment variable to a value that is different to the user's system HOME directory, the extension does not read or write .databrickscfg as specified in the HOME environment variable. Instead, the extension reads and writes .databrickscfg to the user's system HOME directory. When trying to establish a connection however, the extension does respect the HOME environment variable and cannot find .databrickscfg.

To Reproduce

Steps to reproduce the behavior:

  1. Remove all .databrickscfg files
  2. Set the HOME environment variable
  3. Start VS Code
  4. Click "Configure Databricks"
  5. Set the workspace and click "Edit Databricks profiles; Open ~/.databrickscfg"
  6. Save this file

The resulting ~/.databrickscfg file is in the user's system HOME directory, not in the directory specified by the HOME environment variable.

Trying to use this workspace yields the following error:

Connection using "Profile 'DEFAULT'" failed with error: "default auth: cannot configure default credentials. Config: profile=DEFAULT"."

Workaround: copy the .databrickscfg created in the user's system HOME to the directory specified in the HOME environment variable or explicitly set the "Override Databricks Config File" setting.

System information:

  1. Paste the output ot the Help: About command (CMD-Shift-P).

Version: 1.79.2 (user setup)
Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06
Date: 2023-06-14T08:57:04.379Z
Electron: 22.5.7
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045

  1. Databricks Extension Version

v1.0.0

Additional context

I have only attempted to reproduce this on Windows.

Hi @geoffdavey. Thanks for reporting this issue. I will get on ASAP.