ucx icon indicating copy to clipboard operation
ucx copied to clipboard

[BUG]: create-catalogs-schemas fail if the location provided has more than 1 level nesting than the external location

Open mohanab-db opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

I run databricks labs ucx create-catalogs-schemas and provide s3://mohanatest/data/catalog/workspace_1961346165534048 as the managed storage location for a catalog. I have an external location for s3://mohanatest/. The command fails with ERROR [d.l.ucx.create-catalogs-schemas] NotFound: Failed to validate location for workspace_1961346165534048 catalog.

Expected Behavior

The catalog should get created as the existing external location works for the location provided. But the current code only works for 1 level of nesting. Since I am providing 3 level of nesting sub-directories, it fails. For example, location s3://mohanatest/data will work, but location s3://mohanatest/data/catalog fails. Ideally, both should succeed.

Steps To Reproduce

  1. Create external location for s3://mohanatest/
  2. Run databricks labs ucx create-catalogs-schemas
  3. Enter s3://mohanatest/data/catalog/workspace_1961346165534048 when prompted with "Please provide storage location url for catalog:workspace_1961346165534048."

Cloud

AWS

Operating System

macOS

Version

latest via Databricks CLI

Relevant log output

No response

mohanab-db avatar May 15 '24 21:05 mohanab-db

Added a pull request https://github.com/databrickslabs/ucx/pull/1701 for fixing this

mohanab-db avatar May 15 '24 21:05 mohanab-db