Docker n8n runs with uid and gid of 1000.
I had the same problem. The thing is in my VPS the 1000 uid gid is assigned to mysql user. The directories i created with root user didn’t let n8n write files there. You have to chown the folders to that of user 1000.
I had also open a topic but nothing happened. I think in the future they must provide an option to select the uid and gid in docker like many other projects do.