cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

problem switching profile when using databricks cli

NielsMH
New Contributor III

Hi

I have installed databricks CLI and have created some different profiles, and havnt had any problems until now. When i try to use a specific profile with my commands using the --profile flag, fx "databricks secrets list-scopes --profile prod" i encounted the following error: 

Error: cannot resolve bundle auth configuration: config host mismatch: profile uses host https://adb-1014xxxxxx.xx.azuredatabricks.net, but CLI configured to use adb-1953xxxx.xx.azuredatabricks.net

So it seems my databricks cli continues to be linked to my "test" profile somehow.

I have tried to authenticate to the prod workspace, but still encounter the same issue, for my prod profile with:

databricks auth login --host https://adb-1014xxxxxx.xx.azuredatabricks.net 

 Im running my databricks cli commands from the ubuntu terminal in wsl2. Anyone have an idea ro resolve this issue?

alternativly how to properly uninstall databricks cli so i can try and set it up again 

2 REPLIES 2

Gail207Martinez
New Contributor

Hello!

It looks like your Databricks CLI is still linked to your โ€œtestโ€ profile, causing the host mismatch error. Here are a few steps to resolve this:

Check Configuration: Ensure your .databrickscfg file has the correct host for each profile. You can find this file in your home directory.
Specify Profile: When running commands, explicitly specify the profile using the --profile flag:
databricks secrets list-scopes --profile prod

Re-authenticate: Re-authenticate to the correct workspace:
databricks auth login --host https://adb-1014xxxxxx.xx.azuredatabricks.net --profile prod

Uninstall and Reinstall CLI: If the issue persists, you can uninstall and reinstall the Databricks CLI:
pip uninstall databricks-cli
pip install databricks-cli

These steps should help resolve the host mismatch issue.

Good luck!

szymon_dybczak
Contributor

Hi @NielsMH ,

By default, the Databricks CLI looks for the .databrickscfg file in your ~ (your user home) folder on Unix. You can try to delete this file and run configuration process again.
You can also use describe command to check what credentials and the source of those credentials are being used by CLI:

 

 

databricks auth describe

 

But I suspect you may have encountered the case described below, which is CLI is inferring host from the bundle in the same path. To check if that's the case run the command above

https://github.com/databricks/cli/issues/1358

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group