cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Databricks 13.3 Runtime Unable to use Python OS library to access mounted GCP bucket

Kayla
Contributor

In Databricks 12.2, this Python code block lists out the contents of our ad_hoc folder in our mounted GCP bucket.

 

import os
os.listdir('/dbfs/mnt/hlm/ad_hoc/')

 

For some reason in 13.3 this same code block throws a " No such file or directory" error.

1 ACCEPTED SOLUTION

Accepted Solutions

Kayla
Contributor

I've discovered the cause of this issue. The path is functional, but what I'm actually running into is a restriction due to the cluster set to "Shared" access mode:

  • Cannot use R, RDD APIs, or clients that directly read the data from cloud storage, such as DBUtils.

Changing the cluster mode resolved the issue.

View solution in original post

2 REPLIES 2

Kaniz
Community Manager
Community Manager

Hi @KaylaThe error "No such file or directory" indicates that the specified directory does not exist in the DBFS file system. This could be due to several reasons:

- The directory was deleted or moved.
- The directory name has changed.
- The mount point to the GCP bucket is not correctly configured or has been changed.
- The permissions to access the directory have changed. You can use the Databricks DBFS CLI or Databricks Runtime to verify the existence of the directory and the mount point. 

However, it's important to note that the Databricks CLI is unavailable on Databricks for GCP, as stated in the provided source. Therefore, you might want to use Databricks Runtime commands instead.

Kayla
Contributor

I've discovered the cause of this issue. The path is functional, but what I'm actually running into is a restriction due to the cluster set to "Shared" access mode:

  • Cannot use R, RDD APIs, or clients that directly read the data from cloud storage, such as DBUtils.

Changing the cluster mode resolved the issue.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.