databricks / cli

Databricks CLI
Other
147 stars 55 forks source link

Cannot configure an auth profile with a cluster when my workspace has multiple clusters with the same name #974

Open ilia-db opened 1 year ago

ilia-db commented 1 year ago

Describe the issue

Cannot configure an auth profile with a cluster using databricks auth login --host https://***.databricks.com --configure-cluster when my workspace has multiple clusters with the same name.

It seems like the CLI converts clusters to a map using cluster name as an id, which fails when there are multiple such names. Databricks doesn't prevent users from creating multiple clusters with the same name.

Steps to reproduce the behavior

  1. Create multiple clusters with the same name in your workspace
  2. Run databricks auth login --host https://***.databricks.com --configure-cluster

Expected Behavior

I should be able to create a profile and chose a cluster

Actual Behavior

Profile config is not created, and I get this error:

databricks auth login --host https://***.cloud.databricks.com --configure-cluster
✔ Databricks Profile Name: ***
⢿ Loading list of clusters to select fromError: failed to load clusters list. Original error: duplicate .ClusterName: ***

OS and CLI version

macOS, CLI from the latest main commit

Is this a regression?

No

Debug Logs

N/A

crepantherx commented 4 months ago

facing same, did you get solution @ilia-db

andrewnester commented 3 months ago

For now, renaming the clusters or providing value directly to --configure-cluster is the only option