Read/Write Files from Disk → “The file … is not writable.” in queue mode (Docker)

[HELP] Read/Write Files from Disk → “The file … is not writable.” in queue mode (Docker)

Context

  • Deployment: n8n self-hosted with Docker + docker-compose, EXECUTIONS_MODE=queue (UI + worker).

  • Images: n8n and worker are on the same tag (e.g. 1.106.3).

  • Volumes (identical on both n8n and worker; sanitized placeholders):

    - /path/to/n8n_data:/home/node/.n8n
    - /path/to/ENCRYPTION_KEY:/home/node/.n8n/ENCRYPTION_KEY:ro
    - /path/to/n8n_files:/files
    
    
  • Env vars (identical on both):

    - EXECUTIONS_MODE=queue
    - N8N_RESTRICT_FILE_ACCESS_TO=/home/node/.n8n:/files
    # (Other env like DB/Redis creds exist but are not shown here)
    
    

Problem

The Read/Write Files from Disk node (operation: Write File to Disk) often returns:

The file "/files/file_YYYYMMDDHHmmss.json" is not writable.

This happens mostly when clicking Execute step in the editor.

What does work

  • Run workflow (:play_button:): when I run the whole workflow, the worker executes it and the file is written successfully into /path/to/n8n_files.

  • Workaround that always works: using Execute Command to decode and write the binary:

    /bin/sh -lc "printf %s '{{ $binary.data.data }}' | base64 -d > '/files/{{ $binary.data.fileName || ('file_' + $now.format('YYYYMMDD_HHmmss') + '.json') }}'"
    
    

    → File appears in /path/to/n8n_files.

What I’ve already verified

  • Unix permissions on host:

    chown -R 1000:1000 /path/to/n8n_data /path/to/n8n_files
    chmod -R 2775 /path/to/n8n_data /path/to/n8n_files
    
    
  • Write tests from inside containers:

    • From n8n container:

      echo ok > /files/probe_from_n8n
      echo ok > /home/node/.n8n/probe_from_n8n
      
      
    • From worker container:

      echo ok > /files/probe_from_worker
      
      

    All succeed (so mounts + permissions are fine).

  • Env present in both containers:

    printenv N8N_RESTRICT_FILE_ACCESS_TO  =>  /home/node/.n8n:/files
    
    
  • Same image tag on n8n and worker (checked via docker compose images).

Minimal repro workflow

  1. Code — ensure there’s a data binary (strict n8n logic: $input.all() + return items;)
const items = $input.all();

for (const item of items) {
  if (!item.binary?.data) {
    const content = JSON.stringify(item.json ?? { ok: true }, null, 2);
    const base64 = Buffer.from(content).toString('base64');
    item.binary = item.binary || {};
    item.binary.data = { data: base64 };
  }
  const ts = new Date().toISOString().replace(/[-:.TZ]/g,'').slice(0,14);
  item.binary.data.fileName = item.binary.data.fileName || `file_${ts}.json`;
  item.binary.data.fileExtension = 'json';
  item.binary.data.mimeType = 'application/json';
}
return items;

  1. Read/Write Files from DiskWrite File to Disk
  • Input Binary Field: data

  • File Path and Name (FX): /files/{{$binary.data.fileName}}

  • /files exists via the volume above.

Result

  • Execute step:warning: “not writable”.

  • Run workflow (:play_button:):white_check_mark: file is created in /path/to/n8n_files.

Questions for the community

  1. Is this a known issue with Read/Write Files from Disk when using queue mode, especially via Execute step?

  2. Any node options/flags (e.g., “Append to file”, “Create directories”, etc.) that reliably bypass this?

  3. Recommended best practice to write files in queue mode (alternative nodes/patterns)?

  4. If it’s a bug, is there a fixed tag or an existing GitHub issue I can follow?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.