Problem
When attempting to mount a storage account in Databricks, you receive the following error.
ExecutionError: An error occurred while calling <mount-operation>.
: com.databricks.backend.daemon.data.common.InvalidMountException: Error while using path <mount-path> for creating file system within mount at '<mount-path>'.
Caused by: com.databricks.backend.daemon.data.client.adl.AzureCredentialNotFoundException: Could not find ADLS Gen2 Token
Cause
You’re using nested mounts, where one mount is created within another. Nested mounts are not supported.
Example of nested mounts
dbutils.fs.mount(
source="abfss://container1@storageaccount.dfs.core.windows.net",
mount_point="/mnt/storage1"
)
# Now, trying to mount another storage inside /mnt, which is already in use:
dbutils.fs.mount(
source="abfss://container2@storageaccount.dfs.core.windows.net",
mount_point="/mnt/storage1/storage2"
)
Solution
First, unmount the incorrect nested mount.
dbutils.fs.unmount("/mnt")
Then, remount each mount independently, at separate locations.
dbutils.fs.mount(
source="<your-storage-account-path>",
mount_point="/mnt/storage1"
)
dbutils.fs.mount(
source="<your-storage-account-separate-path>",
mount_point="/mnt/storage2"
)