ExecutionError: An error occurred while calling o613.ls. : com.microsoft.azure.datalake.store.ADLException: Error enumerating directory

Rohit Dobbanaboina 45 Reputation points
2023-09-01T05:25:44.17+00:00

Hi,

I have a storage account of general purpose v2 .I am trying to mount this storage account using credential passthrough method.

I have used the following code to mount the storage account.

configs = {
   "fs.adl.oauth2.access.token.provider.type": "CustomAccessTokenProvider",
   "fs.adl.oauth2.access.token.custom.provider": spark.conf.get("spark.databricks.passthrough.adls.tokenProviderClassName")
 }

 # Optionally, you can add <directory-name> to the source URI of your mount point.
dbutils.fs.mount(
   source = "adl://azurestorageaccountuk01.azuredatalakestore.net/",
   mount_point = "/mnt/storage-mount",
   extra_configs = configs)

It has mounted successfully, but i cannot list them when i try dbutils.fs.ls('/mnt/storage-mount/') I face issue.

Error message:

ExecutionError: An error occurred while calling o613.ls. : com.microsoft.azure.datalake.store.ADLException: Error enumerating directory / Operation LISTSTATUS failed with exception java.net.UnknownHostException : azurestorageaccountuk01.azuredatalakestore.net Last encountered exception thrown after 5 tries. [java.net.UnknownHostException,java.net.UnknownHostException,java.net.UnknownHostException,java.net.UnknownHostException,java.net.UnknownHostException]

Also i have enabled Azure Data Lake Storage credential passthrough

Enable credential passthrough for user-level data access -Enabled in Databricks->Cluster->Advanced options

User's image

User's image

User's image

Seeking a quick response.

Thanks in advance

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,155 questions
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,425 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA 90,606 Reputation points
    2023-09-05T09:13:16.5+00:00

    @Rohit Dobbanaboina - Thanks for the question and using MS Q&A platform.

    The error message indicates that there is an issue with enumerating the directory, and the operation LISTSTATUS failed with an exception java.net.UnknownHostException. The customer has also enabled Azure Data Lake Storage credential passthrough for user-level data access.

    To resolve this issue, you can follow the below steps:

    1. Check if the storage account is accessible and the credentials are correct. You can verify this by trying to access the storage account using the Azure Storage Explorer or Azure Portal.
    2. Ensure that the storage account is mounted correctly. You can verify this by checking the mount point and the extra configurations used while mounting the storage account.
    3. Check if the user has the necessary permissions to access the storage account. You can verify this by checking the access control settings for the storage account.
    4. Ensure that the DNS resolution is working correctly. The error message indicates that there is an issue with resolving the hostname. You can verify this by checking the DNS settings for the Azure Databricks workspace.
    5. Check if the firewall settings for the storage account are configured correctly. You can verify this by checking the firewall settings for the storage account and ensuring that the IP address of the Azure Databricks workspace is added to the allowed list.
    6. Check if the storage account is in the same region as the Azure Databricks workspace. If not, you may face latency issues while accessing the storage account.
    7. If the issue persists, you can try using the unmount the existing connection and try to create a new mount and see if that works.

    Here is an example of how to mount an Azure Data Lake Storage Gen1 resource or a folder inside it, use the following commands:

    configs = {
       "fs.adl.oauth2.access.token.provider.type": "CustomAccessTokenProvider",
       "fs.adl.oauth2.access.token.custom.provider": spark.conf.get("spark.databricks.passthrough.adls.tokenProviderClassName")
     }
    
     # Optionally, you can add <directory-name> to the source URI of your mount point.
     dbutils.fs.mount(
       source = "adl://<storage-account-name>.azuredatalakestore.net/<directory-name>",
       mount_point = "/mnt/<mount-name>",
       extra_configs = configs)
    

    As per the repro from our end, I was created a new ADLS Gen1 account named cheprademo and create a Databricks cluster with DBR: 12.2 LTS (includes Apache Spark 3.3.2, Scala 2.12) with Azure Data Lake Storage credential passthrough Enable credential passthrough for user-level data access.

    User's image

    Azure Data Lake Gen1 Storage account:

    User's image

    I'm able to run the code and get the files without any issue:

    User's image

    For more details, refer https://learn.microsoft.com/en-us/azure/databricks/data-governance/credential-passthrough/adls-passthrough#--mount-azure-data-lake-storage-to-dbfs-using-credential-passthrough

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.