I want to read and write local files with the “Read/Write files from Disk” node. The directory in which I want to save or read the files is “/Volumes/SSD drive/Docker/n8n”.
I am using a self-hosted version on my QNAP-NAS, created with docker-compose. I’ve already made the entry in docker-compose.yml according to the documentation.
The node is also executed successfully, but no data is read or written.
Thanks for posting here and welcome to the community!
You can check if you have the right directory in your Disk node with the Execute Command node (pwd command)
How did you map that volume in your docker-compose?
Also, are you specifying the file name in the path? (e.g. “*.txt” for reading a file)
You can share your workflow here by pasting them as JSON in between two block quotes (```).
It could be that the container doesn’t have permissions but as you setting the path for your share to /files in the container I would access the container itself and browse to that path and see if you can touch a file or from inside n8n with an execute command node touch /files/test.txt to see if it makes the file or returns a permission error.
There is no information in the documentation that the folder in the container must exist. I created the folder files, now I can write text.txt to that folder. But I can’t see the file in /Volumes/SSD Laufwerk/Downloads.
I just had the same issue… if you mount a host folder in docker-compose.yml like this…
volumes:
- ./data:/data
…and if the host folder (./data on the left side) does not exist yet, then it will be created by the docker user - and that might be the root user.
The folder in the container (/data on the right side) then “inherits” the host folder permissions and the node user that runs the workflow, cannot write to the folder owned by root.
I just changed the permissions of the host folder, now it works.