databricks/databricks-vscode

[BUG] Error: default auth: metadata-service: dial tcp 127.0.0.1:53405: connectex: No connection could be made because the target machine actively refused it

Closed this issue · 2 comments

Describe the bug
A clear and concise description of what the bug is.

Visual Studio code extension for databricks exhibits a behaviour where databricks cli commands run from the terminal intermittently throws an error "default auth: metadata-service: token response: Get "http://127.0.0.1:53405/49c4dd50-29b4-47f6-a345-e41fbad5d65f": dial tcp 127.0.0.1:53405: connectex: No connection could be made because the target machine actively refused it". This is not a consistent but rather a random behaviour. Commands run from terminal using a random directory works sometimes but fails from other directories.

To Reproduce
Steps to reproduce the behavior:

Screenshots
If applicable, add screenshots to help explain your problem.

Databricks configuration file

image image

After replacing metadata_service_url in databricks cfg file with metadata_service_url from .databricks.env file of a directory from visual studio code we're able to run the commands

image

One additional test we did is to kill a session which is actively listening on a working port.

dbcli commands are running fine from one of the directory with .databricks.env file having metadata_service_url as port number 53405. We kill the session associated with port 53405 as below to replicate the issue. As we can see(in 2nd screenshot), commands fail with same connection refused error.

image image

In summary -

When we have two folders configured with databricks extension (which generates .databricks.env file in each folder with unique port number/unique id for metadata_service_url), dbcli commands work from one folder but fail from another folder.

System information:

  1. Windows 11
  2. Databricks Extension Version - 1.2.4
  3. Databricks CLI v0.209.1

Databricks Extension Logs
Please attach the databricks extension logs

Additional context
Add any other context about the problem here.

Dear @ilia-db Do we have an update on this issue it is blocking our cutsomer?

Hi. The root cause of the issue is that environment variables are not updated properly by VS Code in the terminal. This issue is also reproduceable consistently. We are working on a fix. We should have something in the post holiday release.