-
Notifications
You must be signed in to change notification settings - Fork 101
The tool fails if there are no groups to migrate #360
Description
Getting the following error if there are no groups to migrate:
`AssertionError: Migration groups were not loaded or initialized
AssertionError Traceback (most recent call last)
File ~/.ipykernel/1036/command--1-1857924431:18
15 entry = [ep for ep in metadata.distribution("databricks_labs_ucx").entry_points if ep.name == "runtime"]
16 if entry:
17 # Load and execute the entrypoint, assumes no parameters
---> 18 entry[0].load()()
19 else:
20 import databricks_labs_ucx
File /local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/databricks/labs/ucx/runtime.py:213, in main()
212 def main():
--> 213 trigger(*sys.argv)
File /local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/databricks/labs/ucx/framework/tasks.py:93, in trigger(*argv)
90 cfg = WorkspaceConfig.from_file(Path(args["config"]))
91 logging.getLogger("databricks").setLevel(cfg.log_level)
---> 93 current_task.fn(cfg)
File /local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/databricks/labs/ucx/runtime.py:193, in migrate_permissions(cfg)
191 toolkit = GroupMigrationToolkit(cfg)
192 toolkit.prepare_environment()
--> 193 toolkit.apply_permissions_to_backup_groups()
194 toolkit.replace_workspace_groups_with_account_groups()
195 toolkit.apply_permissions_to_account_groups()
File /local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/databricks/labs/ucx/workspace_access/migration.py:128, in GroupMigrationToolkit.apply_permissions_to_backup_groups(self)
126 def apply_permissions_to_backup_groups(self):
127 self._permissions_manager.apply_group_permissions(
--> 128 self._group_manager.migration_groups_provider, destination="backup"
129 )
File /local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/databricks/labs/ucx/workspace_access/groups.py:186, in GroupManager.migration_groups_provider(self)
184 @Property
185 def migration_groups_provider(self) -> GroupMigrationState:
--> 186 assert len(self._migration_state.groups) > 0, "Migration groups were not loaded or initialized"
187 return self._migration_state
AssertionError: Migration groups were not loaded or initialized`
Log output:
07:06 INFO [d.l.ucx.workspace_access.groups] Preparing groups in the current environment. At this step we'll verify that all groups exist and are of the correct type. If some temporary groups are missing, they'll be created 07:06 INFO [d.l.ucx.workspace_access.groups] No group listing provided, all available workspace-level groups that have an account-level group with the same name will be used 07:06 INFO [d.l.ucx.workspace_access.groups] Prepared 0 groups for migration 07:06 INFO [d.l.ucx.workspace_access.groups] Environment prepared successfully