r/docker 7d ago

Need help with n8n (local host through docker)

I am using a Read from disk node to feed data (through a data sheet .xlsx also tried .pdf before) but I keep getting No file found even when I put exact path.. I have been trying to fix it for soo long now I used Gemini for help it told me to use some pathway like /home/nodes/files/.pdf but then it showed NO access error Idk what to do followed some youtube advice as well nothing is working..

1 Upvotes

9 comments sorted by

3

u/Mr_Albal 7d ago

I take it the file is in your host filesystem and n8n is looking in the Docker container. Therefore you need to map a volume from your host into the container.

1

u/Medium_Antelope_7037 3d ago

yeah this is almost always a volume mapping issue, classic gotcha

1

u/Only-Stable3973 7d ago

Maybe you could share your docker-compose.yml so we can take a look for you.

0

u/Jolly_Teach_5165 7d ago

I tried to find that find aswell it doesn't exist on my disk atleast idk how to get that files could you please help me further

1

u/burstinrust 7d ago

This isnt a bug, it docker design, as n8n is running inside a docker container, and a container has its own isolated filesystem, it CANT see the files on your pc.
so look for how to add a file path for your running container.

it would be something like:

docker run: add -v C:/Users/you/n8n-files:/files

docker compose: under the n8n service add

volumes:

- ./local-files:/files

then restart, put the xlsx in that folder, and in the node use

/files/yourfile.xlsx (the container path, NOT your pc path)

this is quite a quick answer i typed here, just paste this to your llm, hopefully it can make it more neat.

if not, feel free to dm me :)

1

u/Jolly_Teach_5165 7d ago

Will try thanks ❤️👍

1

u/Impossible_Fault_503 7d ago

There are two separate problems here and you have hit both, which is why it feels unfixable.

First, the path has to exist inside the container, not on your host. n8n can only see what you mounted into it. In compose:

volumes:
  - /home/you/files:/data/files

Then verify it rather than trusting it:

docker exec -it n8n ls -la /data/files

If that comes back empty or errors, the mount is wrong and no path you type into the node will ever work. Once it lists your file, use /data/files/yourfile.xlsx in the node, not the host path.

Second, your "no access" error is the other half of it. The n8n image runs as the node user, uid 1000, not root. A mounted directory owned by root will list fine and still refuse to read. On the host:

sudo chown -R 1000:1000 /home/you/files

Do the docker exec check first, because it tells you which of the two you are actually fighting instead of changing both at once.

0

u/Jolly_Teach_5165 7d ago

How do I do that 😭 I been trying since afternoon doing as gemini told me nothing worked

1

u/Mr_Albal 7d ago

put this into gemini - it's a perfect explanation:

how to map a volume in docker