databrickslabs / ucx

Automated migrations to Unity Catalog
Other
221 stars 77 forks source link

[BUG]: `account_installer.join_collection` fails when user does not have access to other workspace #1960

Closed JCZuurmond closed 3 months ago

JCZuurmond commented 3 months ago

Is there an existing issue for this?

Current Behavior

After the ucx workspace installation, the join_collection is called, which requires access to account and its workspace. It fails if a user does not have access, even though when the user does not desire to join the ucx collection:

07:49:43  INFO [d.l.ucx.install] Triggering the assessment workflow
Open assessment Job url that just triggered ? [https://adb-REDACTED.x.azuredatabricks.net#job/REDACTED](https://adb-REDACTED.x.azuredatabricks.net/#job/REDACTED) (default: no): yes
Please provide the Databricks account id: REDACTED
Please provide the Databricks account id: REDACTED
Traceback (most recent call last):
  File "/Users/REDACTED/.databricks/labs/ucx/lib/src/databricks/labs/ucx/install.py", line 831, in <module>
    account_installer.join_collection(
  File "/Users/REDACTED/.databricks/labs/ucx/lib/src/databricks/labs/ucx/install.py", line 695, in join_collection
    ids_to_workspace = self._get_workspace_info(current_workspace_id)
  File "/Users/REDACTED/.databricks/labs/ucx/lib/src/databricks/labs/ucx/install.py", line 682, in _get_workspace_info
    return workspace_info.load_workspace_info()
  File "/Users/REDACTED/.databricks/labs/ucx/lib/src/databricks/labs/ucx/account/workspaces.py", line 264, in load_workspace_info
    raise ValueError(msg) from None
ValueError: Please run as account-admin: databricks labs ucx sync-workspace-info
Error: installer: exit status 1

Expected Behavior

The ucx command chould not fail. OR only after the user signaled it wants to join the ucx collection but we can not.

Steps To Reproduce

See current behavior

Cloud

Azure

Operating System

macOS

Version

latest via Databricks CLI

Relevant log output

No response