In windows docker desktop - n8n image installed. unable to read/write from disk

how to mount C: folder with the container volume to allow n8n flow read from disk

Describe the problem/error/question

in windows docker desktop - n8n image installed. unable to read/write from disk

What is the error message (if any)?

NodeApiError: No file(s) found at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Files/ReadWriteFile/actions/read.operation.ts:158:10) at processTicksAndRejections (node:internal/process/task_queues:104:5) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Files/ReadWriteFile/ReadWriteFile.node.ts:65:17) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1045:8) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1224:11) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1672:27 at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2324:11

Please share your workflow

just started the workflow. read/write from disk.

used these volume and variable while running the image:

Volume:
Host path=n8n_data container path = /home/node/.n8n
Host path=./n8n-disk-files container path = /files —–> this also doubt - how to mount C: directory
Environment Variable:
GENERIC_TIMEZONE=Asia/Kolkata
TZ=Asia/Kolkata
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
N8N_RUNNERS_ENABLED=true
N8N_RESTRICT_FILE_ACCESS_TO=/files

created this folder in C: n8n-disk-files —→ this is my biggest doubt. is it at right location.

Information on your n8n setup

  • n8n version: 2.16.2
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): windows docker
  • Operating system: windows

welcome @Tushar_Sinha

Three things must be set correctly:

Setting What to Use
Windows folder C:\n8n-disk-files (create this)
Container path (mount) /home/node/.n8n-files (exactly!)
Environment variable N8N_RESTRICT_FILE_ACCESS_TO=/home/node/.n8n-files

When referencing a file in the Read/Write Files from Disk node, use

/home/node/.n8n-files/your-file.txt

Hi @Tushar_Sinha

@Tushar_Sinha , welcome to the n8n community !
that one got me too! instead of ./n8n-disk-files use the full path like /c/Users/YourUsername/n8n-disk-files in docker desktop on windows. make sure the folder exists before starting the container and you should be good to go!

@Tushar_Sinha welcome! the others nailed the mount path stuff but nobody mentioned you need to use the container path in the node itself, not the windows path. here’s a minimal read workflow that points to /files which is where your mount lands:

fix your docker run to use the full windows path like -v C:\n8n-disk-files:/files and set N8N_RESTRICT_FILE_ACCESS_TO=/files, drop a test.txt in that folder and run it.

Thanks.. but it didnt worked for me. can you tell me all host and container path values you have used please.

yes yes using Host path = c:\n8n-disk-files & container path = /files this worked.

and in n8n using this “/files/DMAT.xlsx” this worked…. my DMAT file get loaded.

thanks thanks….