Problem with file permissions in bind mounts (windows smb / mac OS / Docker Desktop)

I have set up a Webhook Workflow that grabs job information from our production workflow and converts this via html and gotenberg into pdf. This pdf file is placed in a smb mounted bind mount. The problem is, that apparently Docker Desktop is still somehow using these files so the i can’t delete them in macOS or in the windows evnironment. I already followed instructions of ChatGPT to set the mount in docker-compose.yml to “:delegate” oder “:cached” - this didn’t help me.

When i kill the open file connection on my windows server in computer management i can delete it.

Do you have any advice how to stop docker desktop from using these files? Or maybe i can set up a Node that deletes the files in this workflow after 60 seconds?

  • n8n version: 1.70.3
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker Desktop on macOS
  • Operating system: macOS Monterey

I have now tried with an Execute Command node with the following command:

rm {{ $json.fileName }}

It seems even n8n itself can’t stop the running process of docker?

Command failed: rm /data/autoprint/RicohA4Schwarz/XYZ.pdf rm: can’t stat ‘/data/autoprint/RicohA4Schwarz/XYZ.pdf’: Permission denied

I have now been able to see on my Windows server that my macOS user is still accessing these files. When I search for the process in the terminal on macOS, Apple Virtualization Process is displayed. This indicates a problem with Docker Desktop, doesn’t it? I have connected the shares as a bind mount, is this more a case for a Docker volume? I can’t quite make sense of the Docker documentation.

hello @ToHo

can you share the worflow?

Here is the part with the writing process and my attempt to delete via the process itself. Currently i am running the workflow via ftp-upload and that works perfectly. But i want to understand why n8n or docker desktop is still using these files and how i can solve that for upcoming workflows.

I always thought that would be my biggest advantage of self hosting, that i can work on my system. But apparently this is not so easy.

How are you attaching that path?

It is mounted with bind mount in Docker Desktop / my Docker-compose.yml file.

can you provide the exact command of entire compose config (you can remove any sensitive info from it) ?