Out of sync for opened files with File Versioning enabled

I have made a setup with two syncthing “servers” which are virtual running one on OpenBSD, second on FreeBSD. Both are version v0.14.10, FreeBSD (64 bit) / OpenBSD (64 bit). All home PC’s “clients” are using Windows 64-bit v.0.14.10. Every “client” is sharing one folder with both “servers”. Those folders on “server” side are setup with Simple File Versioning / Staggered file version (checked both ways). If no file versioning is setup, seems it’s working fine. The problem seems to happen when on client is edited Word or Excel file for a longer time, then the file goes in “out of sync” mode. Resolution is to log on to *BSD box, go to appropriate directory, and delete the file (e.g. Maaja.xlsx):

# cd /home/syncthing/sync/u_o/Desktop/
# ls -l
total 912
-rw-r--r--  1 syncthing  syncthing   12884 Nov  3 21:19 .syncthing.Maaja.xlsx.tmp
-rw-r--r--  1 syncthing  syncthing   12292 Nov  2 16:26 Maaja.xlsx

When I delete Maaja.xlsx it will sync and .syncthing.Maaja.xlsx.tmp file will be gone.

Syncthing is running as user “syncthing” which has full access on file level, but when I try to remove file it gives “permission denied” error. It’s possible to delete file only with root user.

All those thing are identical both on FreeBSD and OpenBSD boxes. syncthing-1

I think this is a bug issue, but was closed. So any help would be appreciated :slight_smile:

Excel/word potentially locks files making them unreadable/unwritable so not much we can do about this, I am more or less sure it would fix itself if you closed the application.

Also not sure why you are mentioning versioning as none of the files you listed relate to that, so not sure whats the connection.

If you click on the out of sync hyperlink shown, it will open a dialog explaining which file cannot be synced and why.

Lastly, this is a support issue until it’s proven otherwise, as from your initial report it feels more like mis-expectations oppose to a bug, as its not obvious what needs fixing.

No, it’s not fixing even after a week, reboots of all clients, closing Word/Excel, etc… This also happening already from beginning of my use of syncthing, think It was v0.12 (May of this year).

Opened a syncthing in console mode, got a plenty of rows which repeteating every minute:

[BOX3Z] 11:32:49 INFO: Puller: final: rename /home/syncthing/sync/u_m/Documents/syncthing.txt /home/syncthing/sync/u_m/.stversions/Documents/syncthing~20161031-214938.txt: permission denied

If I run

$ mv /home/syncthing/sync/u_m/Documents/syncthing.txt /home/syncthing/sync/u_m/.stversions/Documents/syncthing~20161031-214938.txt mv: rename /home/syncthing/sync/u_m/Documents/syncthing.txt to /home/syncthing/sync/u_m/.stversions/Documents/syncthing~20161031-214938.txt: Permission denied $ cp /home/syncthing/sync/u_m/Documents/syncthing.txt /home/syncthing/sync/u_m/.stversions/Documents/syncthing~20161031-214938.txt

so syncthing somehow locks a file, which it can’t move later on to .stversions. If I delete file /home/syncthing/sync/u_m/Documents/syncthing.txt then .tmp file is renamed and everything is ok till next time…

I mentioned versioning because if I turn it off, it’s never shows “Out of sync” for those files.

On out of sync items I don’t see any explanation, in previous version (v.013) it showed a “permission denied”.

It’s the parent directory permissions that are causing this, nothing todo with syncthing most likely.

Hold on, this makes no sense. run the mv via strace.

Actually, the problem is probably with permissioms on that file, as it’s not writable hence cannot be renamed, only copied.

Yes, that’s strange enough, but directories /home/syncthing/sync/u_m/ are: drWxr-xr-x but part of lower dir’s (which were made by syncthing client) are: dr-xr-xr-x.

Now made

chmod -R 0755 ./ from syncthing user, it could make changes to permissions of files, so now can operate with files.

Now it’s rescanning all of files, will take some time as there are 63188 items, ~272 GiB

It’s not clear for me why part of folder permission where made dr-xr-xr-x?

Maybe I need to use “[x] Ignore Permissions” option?

Well syncthing syncs permissions, so if excel or whatever messes with them, the mess will be synced back.

Sycnthing tires not to improvise with permissions, so unless you have a reproducible scenario proving it’s caused and originates from syncthing, I’d say its not our fault.

The permissions where incorrect for folders, not files. Folders on server where created by syncthing synchronizing from client PC’s.

Well syncthing just uses Mkdir syscall, which uses the umask that it was given when it was started.

I have no umask defined neither in command line, neither in config.xml file. Can’t see also in GUI’s advanced options… What’s default one? How can i define umask in config?

It inherits tue umask from the parent that launches syncthing.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.