Btsync Replacing New Files With Old (Despite Correct Times)


sorrysyncer

Recommended Posts

Hi,

 

I'm having problems with btsync repeatedly replacing newly edited files with old ones.  Searching around the forums, people are generally diagnosing this as a problem with timestamps or clocks, but I don't think this is the case for me.

 

Background - I have 1 Windows Desktop, 1 Linux Desktop, 1 Linux Server, and 2 Android Devices.  The Windows/Linux machines have NTP.  I guess the Android devices do too (their clocks always appear to be spot on, anyway.)

 

I decided to keep an eye on the file to catch this happening so I ran on the Linux desktop:

while sleep 15 ; do echo "$(date) $(ls -l 'Move_21.txt')" ; done

 

 

Here's some output (date on the left is the time, date on the right is the file timestamp):

 


Tue Feb 25 19:45:28 GMT 2014 -rw-r--r-- 1 jim jim 688 Feb 25 19:43 Move_21.txtTue Feb 25 19:45:43 GMT 2014 -rw-r--r-- 1 jim jim 688 Feb 25 19:43 Move_21.txtTue Feb 25 19:45:58 GMT 2014 -rw-r--r-- 1 jim jim 688 Feb 25 19:43 Move_21.txt... a bit later I do some edits on the file...Tue Feb 25 19:52:43 GMT 2014 -rw-r--r-- 1 jim jim 688 Feb 25 19:43 Move_21.txtTue Feb 25 19:52:58 GMT 2014 -rw-r--r-- 1 jim jim 686 Feb 25 19:52 Move_21.txt... and some more later...Tue Feb 25 20:09:59 GMT 2014 -rw-r--r-- 1 jim jim 686 Feb 25 19:52 Move_21.txtTue Feb 25 20:10:14 GMT 2014 -rw-r--r-- 1 jim jim 928 Feb 25 20:10 Move_21.txt....and some more...Tue Feb 25 20:11:00 GMT 2014 -rw-r--r-- 1 jim jim 943 Feb 25 20:10 Move_21.txtTue Feb 25 20:11:15 GMT 2014 -rw-r--r-- 1 jim jim 952 Feb 25 20:11 Move_21.txtTue Feb 25 20:11:30 GMT 2014 -rw-r--r-- 1 jim jim 952 Feb 25 20:11 Move_21.txt... and then suddenly, my software reports "the file you are editing has changed on disk", and sure enough....Tue Feb 25 20:11:45 GMT 2014 -rw-r--r-- 1 jim jim 688 Feb 25 19:43 Move_21.txt... back to the 19:43 version.  A bit later, I save over the top of that...Tue Feb 25 20:35:16 GMT 2014 -rw-r--r-- 1 jim jim 688 Feb 25 19:43 Move_21.txtTue Feb 25 20:35:31 GMT 2014 -rw-r--r-- 1 jim jim 952 Feb 25 20:35 Move_21.txt... more edits...Tue Feb 25 20:37:16 GMT 2014 -rw-r--r-- 1 jim jim 952 Feb 25 20:35 Move_21.txtTue Feb 25 20:37:31 GMT 2014 -rw-r--r-- 1 jim jim 1483 Feb 25 20:37 Move_21.txt... more edits...Tue Feb 25 20:37:31 GMT 2014 -rw-r--r-- 1 jim jim 1483 Feb 25 20:37 Move_21.txtTue Feb 25 20:37:46 GMT 2014 -rw-r--r-- 1 jim jim 1220 Feb 25 20:37 Move_21.txt... but then back we go to the 19:43 version...Tue Feb 25 20:41:46 GMT 2014 -rw-r--r-- 1 jim jim 1212 Feb 25 20:38 Move_21.txtTue Feb 25 20:42:01 GMT 2014 -rw-r--r-- 1 jim jim 688 Feb 25 19:43 Move_21.txt

I've switched on debug logging on the Linux desktop and server.

 

It appears to be that the old version of the file is being restored each time my phone syncs - the problems happen every 30 minutes (which is how often the phone is set to sync) , and I can see in the logs on the Linux server that is is picking up what it thinks is an updated version of the file (but is actually old) when that sync happens:

 

However, I definitely haven't touched the file on the phone in this period.  Or ever, in fact - despite the filename being a .txt file, this is actually a specially formatted file that I don't have the software to edit on my phone.

 

Here's an example:

 

[20140225 20:44:37.077] SyncFilesController [file updated]: processing file /blah/blah/Move_21.txt 1393357396 688
 

In fact, it looks like there are lines like this for every single file in the share.

 

So, my questions are:

1. Is this a known issue?

2. Can this really be due to timestamps/clocks?  If yes, why does the timestamp on the copy of the file that is restored have a correct, old, timestamp?  ie... I can accept that if the phone thinks the timestamp on the old file is later than the new file, is will cause btsync to replace the new copy with the old.  HOWEVER - if that happened, I would expect the phones incorrect future timestamp to end up on my local version of the file (not the timestamp from the old version)

3. Is there any more from the debug logs I can provide that will be useful?  They are kind of big (and full of filenames/IPs I'd want to sanitise before posting.)  It seems that the most useful device to get debug info from would be the Android phone that seems to be triggering the problem, but I'm not sure if that's possible.

 

Thanks in advance,

SS

 

Edited by sorrysyncer
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.