Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] metadata-service auth type returns empty token #916

Open
ericfeunekes opened this issue Oct 25, 2023 · 7 comments
Open

[BUG] metadata-service auth type returns empty token #916

ericfeunekes opened this issue Oct 25, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@ericfeunekes
Copy link

Describe the bug
Once I connect to the Databricks server from the VS Code extention, it adds .databricks/databricks.env that includes a variable DATABRICKS_AUTH_TYPE=metadata-service. I think this causes problems with authentication because I get the following error in the VS Code output window:
create_and_register_databricks_globals - ValueError: default auth: metadata-service: Metadata Service returned empty token. Config: host=https://"https://***.azuredatabricks.net/", auth_type=metadata-service, cluster_id=***, metadata_service_url=***. Env: DATABRICKS_HOST, DATABRICKS_AUTH_TYPE, DATABRICKS_CLUSTER_ID, DATABRICKS_METADATA_SERVICE_URL

To Reproduce
Steps to reproduce the behavior:

  1. Follow instructions to authenticate.
  2. Try to connect using Databricks connect in a jupyter notebook
  3. Get the error above

System information:

  1. Paste the output ot the Help: About command (CMD-Shift-P).
Version: 1.83.1 (Universal)
Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc
Date: 2023-10-10T23:46:55.789Z (2 wks ago)
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 22.6.0
  1. Databricks Extension Version
    1.2.2
@ericfeunekes ericfeunekes added the bug Something isn't working label Oct 25, 2023
@kartikgupta-db
Copy link
Contributor

Hi @ericfeunekes. This error should only be affecting local notebooks. Can you confirm that other parts of the extension are affected as well? (eg running a python file)

@ericfeunekes
Copy link
Author

Yes that seems to be true. I don't really have a python file to run that way, but I do know it can connect to and show clusters, sync files, etc.

@Createdd
Copy link

I have the same issue. Is there any way to inspect this error in more detail? Otherwise, how to solve this namespace issue?

@ericfeunekes
Copy link
Author

Hi @ericfeunekes. This error should only be affecting local notebooks. Can you confirm that other parts of the extension are affected as well? (eg running a python file)

This also affects the cli though. Recently I used the vs code extension and then opened a new terminal outside of vs code (in iterm2). When I tried using the cli it gave me the same error.

It seems like the extension is setting a global environment variable that needs to be unset for the cli to work.

This makes the extension break more than it helps.

@pernilak
Copy link

I have a similar problem. The extension takes over my databricks CLI. In stead of using the profile in my .databrickscfg or the configurations in my databricks.yml, it sets thing up with a default cluster (that I specified in the extension) and uses metadata-service as authentication method instead of azure cli.

@cltj
Copy link

cltj commented Dec 18, 2023

Experiencing the same. Kindly suggest a workaround for this.

@ianepreston
Copy link

I was able to work around this issue by updating the DATABRICKS_AUTH_TYPE environment variable to match my preferred authentication. So in my case that was export DATABRICKS_AUTH_TYPE=azure_cli The terraform provider docs have a list of the possible auth types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants