Error: There was an error: EACCES: permission denied, mkdir

Hello, happy to be here:) Have an issue with implementing logging system on n8n.
Could you please help me.

I’ve added

- N8N_LOG_LEVEL=debug
      - N8N_LOG_OUTPUT=console,file
      - N8N_LOG_FILE_LOCATION=/home/****/n8n/logs/n8n.log
      - N8N_LOG_FILE_MAXSIZE=20
      - N8N_LOG_FILE_MAXCOUNT=60

to my environments. But I am getting this error ? All that dirs in a path have 777 permissions.

2022-07-26T23:01:03.499909768Z  ›   Error: There was an error: EACCES: permission denied, mkdir 
2022-07-26T23:01:03.499949654Z  ›   '/home/****/n8n/logs'

Hi @Ruslan_Yanyshyn, welcome to the community!

This sounds like the user account n8n is running under doesn’t have write permission in your directory.

If you manually create the directory you want to write the logfile in and set the permissions correctly, does the error disappear?

Here’s what I did, I created the directory manually, but the error still persists. I have no idea what’s going on. All folders have drwxrwxrwx permissions and current user own them.

Oh, how are you running n8n? Are you using docker by any chance?

Yes I am using a docker.

Okay, I’d guess that the asterisks in /home/****/n8n/logs inside your docker container don’t stand for node then? The default n8n docker image would use a username of node, so you might need to do something as described here for this to work: Error: unable to find the IP address for the container after upgrade to 0.185.0 - #5 by MutedJam

1 Like

Thank you very much!