Problem in node ‘Read/Write Files from Disk‘ The file "/data/file.log" is not writable

Hi everyone, I need a little help — I just can’t figure this out.

I have this docker compose:

version: "3.9"

services:
  n8n:
    image: n8nio/n8n:1.123.0
    container_name: n8n
    restart: unless-stopped
    user: "node"
    ports:
      - "127.0.0.1:32785:5678"
    environment:
      NODE_ENV: "production"
      N8N_RELEASE_TYPE: "stable"
      N8N_PROTOCOL: "https"
      N8N_HOST: "automation.domain.tld"
      GENERIC_TIMEZONE: "Europe/Rome"
      N8N_SECURE_COOKIE: "true"
      N8N_RUNNERS_ENABLED: "true"
      NODE_FUNCTION_ALLOW_BUILTIN: "fs,path"
      N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USATE: "true"
      WEBHOOK_URL: "https://automation.domain.tld"
      DB_SQLITE_POOL_SIZE: "200"
      N8N_ENCRYPTION_KEY: "<REDACTED>"
      WHATSAPP_VERIFY_TOKEN: "<REDACTED>"
      N8N_LICENSE_ACTIVATION_KEY: "<REDACTED>"
      N8N_LICENSE_AUTO_RENEW_ENABLED: "true"
      N8N_PROXY_HOPS: "1"
      N8N_BLOCK_ENV_ACCESS_IN_NODE: "false"
      N8N_GIT_NODE_DISABLE_BARE_REPOS: "true"
      N8N_RESTRICT_FILE_ACCESS_TO: "/backup:/data/shared:/home/node/.n8n/data"
      N8N_DEFAULT_BINARY_DATA_MODE: "filesystem"
    volumes:
      - /home/administrator/n8n/local-files:/home/node/.n8n/data
      - /home/administrator/n8n/backup:/backup
      - /home/administrator/n8n/shared:/data/shared
      - /home/administrator/n8n/data:/home/node/.n8n
    entrypoint: ["tini", "--", "/docker-entrypoint.sh"]
    working_dir: /home/node
    networks:
      - default

networks:
  default:
    driver: bridge

However, when I use the “Read/Write Files from Disk” node, I always get the error:
“The file ‘/data/file.log’ is not writable.”

I checked the folder permissions and they are correctly set.

What am I doing wrong?

Hello @pino74, Welcome!

First, try using /data/shared/file.log or the full path, If that doesn’t work then:

Try setting only one path here, I remember it being buggy when multiple paths were set.

So set the variable to just:

N8N_RESTRICT_FILE_ACCESS_TO=/backup

Then try writing the file to /backup/file.log

1 Like

Thank you very much, mohamed3nan. I solved it by setting only one directory in N8N_RESTRICT_FILE_ACCESS_TO.

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