The node fails with a “Permission denied” or “Access not allowed” error when trying to read or write files to a specific local directory, even though I am using absolute paths.
If you are using version 2 of n8n, then please take note of the following breaking change where reading files from disk is disabled by default. You will need to also se this environment variable to enable disk access:
Hey! I encountered the same issue recently. The “Read/Write Files from Disk” node is restricted to the n8n user folder by default to prevent unauthorized access to your system.
To access files on your D: drive, you need to lift these restrictions using environment variables. Here is the quickest way to solve it:
Stop your n8n instance.
Open your Command Prompt and set the following variables:
set N8N_BLOCK_FS_WRITE_ACCESS=false
set N8N_BLOCK_FS_READ_ACCESS=false
Start n8n again using n8n start.
Pro Tip: If you want this to work every time you reboot your PC, add these variables to your “Environment Variables” in Windows System Settings. This way, you won’t have to type the commands every time.
Hi !
Same problem here !
Since updating to the V2 version of the Write to Disk node, I’ve been unable to get it working on my Docker-hosted n8n instance. I keep encountering an ‘Access Denied’ error every time the node tries to execute.
I have tried several configurations in my docker-compose.yaml file to fix the permissions, but without success.
Could someone with a professional eye take a look at my YAML configuration? I suspect I might be missing a volume mapping or a specific environment variable required for the new node version.
hi
i am having the same issue but when write file to disk i have tried changing the envioment varibles i have tried this on docker and on npn and on ubuntu desktop it does not work if anything works please let me know
You need the environment variable N8N_RESTRICT_FILE_ACCESS_TO.
In your case, if you want to allow n8n to access /volume1/docker/n8n/files (= /files in the container), you need to add in your docker-compose.yaml: N8N_RESTRICT_FILE_ACCESS_TO=”/files”
I also facing this issue, then to fix this issue need add this ENV variable with specific location:
example on my case:
N8N_RESTRICT_FILE_ACCESS_TO=/home/node/.n8n/tmp_videos
Adjust the location /home/node/.n8n/tmp_videos
then on the node set the PATH
/home/node/.n8n-files/samplefile.txt