Survey banner
The Dataiku Community is moving to a new home! We are temporary in read only mode: LEARN MORE

Permissions Denied error

Solved!
Mingyan
Level 1
Permissions Denied error

I want to read a docx file in my dataiku folder through python recipes, but it returns permission denied. How can I change my folder access permissions?

# Read recipe inputs
Dataset_folder = dataiku.Folder("DYV5ukXU")
folder = Dataset_folder.get_info()
doc_path = os.path.join(folder["path"], "GDMS005_001.docx")

f = open(doc_path)

---------------------------------------------------------------------------
PermissionError                           Traceback (most recent call last)
<ipython-input-4-da12e1b887da> in <cell line: 1>()
----> 1 f = open(doc_path)

PermissionError: [Errno 13] Permission denied: '/data/dataiku/dss_data/managed_folders/TUMING/DYV5ukXU/GDMS005_001.docx'

Operating system used: Windows 11

0 Kudos
1 Solution
AlexT
Dataiker

Hi,
To use the absolute path for the managed folder without getting permission error you need to meet the following conditions

1) You must run the job/recipe locally not in a container. If you use a container you must use the remote managed folder option get_download/upload_stream.

2) You must use get_path() API call to set appropriate ACLs and permission before being to call the path using "os" package. You can try something like this:

Dataset_folder = dataiku.Folder("DYV5ukXU")
folder = Dataset_folder.get_info()

path = folder.get_path()
doc_path = os.path.join(path, "GDMS005_001.docx")


https://developer.dataiku.com/latest/concepts-and-examples/managed-folders.html#detailed-examples

Thanks

View solution in original post

1 Reply
AlexT
Dataiker

Hi,
To use the absolute path for the managed folder without getting permission error you need to meet the following conditions

1) You must run the job/recipe locally not in a container. If you use a container you must use the remote managed folder option get_download/upload_stream.

2) You must use get_path() API call to set appropriate ACLs and permission before being to call the path using "os" package. You can try something like this:

Dataset_folder = dataiku.Folder("DYV5ukXU")
folder = Dataset_folder.get_info()

path = folder.get_path()
doc_path = os.path.join(path, "GDMS005_001.docx")


https://developer.dataiku.com/latest/concepts-and-examples/managed-folders.html#detailed-examples

Thanks