FFS complains writing log file (Linux). Runs OK.

Get help for specific problems
Posts: 13
Joined: 12 Mar 2026

keith7465

I have a mounted folder (on a Linux machine) to my PC and am running FFS as a user cron job on the Linux machine. I want to place the FFS log onto the PC. After job completion, I get this error.

03:03:35 AM Error: Cannot write file "/mnt/nuc/ffs_logs/[FFS SVR] SD to FileStore 2026-03-13 030001.435.html".
Cannot create directory "/mnt/nuc/ffs_logs".
EEXIST: File exists [mkdir]

Why is FFS trying to create a directory (/mnt/nuc/ffs_logs) which already exists and the user has write access to? The owner of the mounted folder is myself and the user running cron is the same. If I run FFS in a GUI session, it completes as I expect. The cron job runs OK, but the output is in the user folder (~/.config/...).

Am I missing something here?
User avatar
Site Admin
Posts: 7523
Joined: 9 Dec 2007

Zenju

I'm assuming this is not reproducible?
Unfortunately the failed access check after mkdir is not reported by FFS, which could have given further clues. I've added it for the next release.
Posts: 13
Joined: 12 Mar 2026

keith7465

Interesting you asked, because I checked and it seems the last 2 runs have been fine. Before that it happened a lot of times, so many I believed that the run wasn't happening. It was only after I discovered the ".config" folder was being used I realised it was erroring on the log folder I set and running OK after that.

Thanks for listening!
Posts: 13
Joined: 12 Mar 2026

keith7465

OK, I know what is happening (and reproducible, but I fixed it on my end).

My FFS task is to backup changed files on one NAS to another. It runs on a small Ubuntu server and it scheduled with cron to run in the early morning.

The issue was that my main PC, where I want to write the log file to, is sleeping at that time. So the write fails, but FFS nicely writes it instead to the .config folder on the Linux system. That is where the error message comes from I guess. The log folder is a network mount on the Linux box to my PC, which is sleeping. So FFS tries (and fails) to create the logfile, probably assumes the folder isn't there and tries to create it?

Because when I ran this script in a GUI session I ran it from my PC, my PC was always online and the failure was never seen.

I stopped my PC sleeping and everything works fine. Not the best fix, I should probably have it wake on LAN but I'm happy right now.

Does that make sense?
User avatar
Site Admin
Posts: 7523
Joined: 9 Dec 2007

Zenju

Yes, I suspect this is a race condition due to file system buffering. FFS tries to create the directory, which fails (because it's already existing), after that it checks if the directory is already existing (and receives the incorrect/stale info that directory is not existing). Had FFS received the correct info that directory is existing, it would silently continue, but instead it throws the original error "EEXIST: File exists [mkdir]".