Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filewatcher not updating on copied files or changed files #256

Closed
sfcmgr opened this issue Apr 26, 2016 · 53 comments
Closed

Filewatcher not updating on copied files or changed files #256

sfcmgr opened this issue Apr 26, 2016 · 53 comments

Comments

@sfcmgr
Copy link

sfcmgr commented Apr 26, 2016

Have noticed today that copied files and changed files are no longer being picked up by the synctrayzor filewatcher when they occur,

If I then create a new file after copying or adding content to a file, the watcher kicks in and all the changed / copied / new files sync

The synctrayzor.log runs this while the files are being copied or edited

2016-04-26 14:18:44.2450 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:18:44.2606 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <GenericEvent ID=310 Type=Ping Time=26/04/2016 14:18:44 Data=null> 
2016-04-26 14:19:44.2568 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:19:44.2724 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <GenericEvent ID=311 Type=Ping Time=26/04/2016 14:19:44 Data=null> 
2016-04-26 14:20:44.2711 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:20:44.2868 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <GenericEvent ID=312 Type=Ping Time=26/04/2016 14:20:44 Data=null> 

and when I create the new file this happens

2016-04-26 14:21:10.5979 #1588 [Info] SyncTrayzor.Services.DirectoryWatcher: Path Changed: c:\localdocs\username\New Text Document.txt 
2016-04-26 14:21:10.5979 #1588 [Debug] SyncTrayzor.Syncthing.ApiClient.SyncthingApiClient: Scanning folder: username subPath: New Text Document.txt 
2016-04-26 14:21:10.6291 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:21:10.6316 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=313 Time=26/04/2016 14:21:10 Folder=username From=idle To=scanning Duration=00:02:47.1550000> 
2016-04-26 14:21:11.8742 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:21:11.9054 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <LocalIndexUpdated ID=314 Time=26/04/2016 14:21:11 Folder=username Items=2 Version=10128> 
2016-04-26 14:21:12.4202 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:21:12.4202 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <RemoteIndexUpdatedEvent ID=315 Time=26/04/2016 14:21:12 Device=<DEVICEID> Folder=username Items=2> 
2016-04-26 14:21:12.5918 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:21:12.5918 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <FolderSummary ID=316 Time=26/04/2016 14:21:12 Folder=username Summary=<FolderStatus GlobalBytes=4030809690 GlobalDeleted=1548 GlobalFiles=7356 LocalBytes=4030780634 LocalDeleted=1321 LocalFiles=7356 InSyncBytes=4030809690 InSyncFiles=7356 NeedBytes=0 NeedFiles=0 IgnorePattners=False, Invalid= State=scanning StateChanged=26/04/2016 14:21:10 Version=1296261>> 
2016-04-26 14:21:12.5918 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:21:12.6074 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <GenericEvent ID=317 Type=FolderCompletion Time=26/04/2016 14:21:12 Data={"completion":100,"device":"<DEVICEID>","folder":"username"}> 
2016-04-26 14:21:12.8727 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:21:12.8727 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=318 Time=26/04/2016 14:21:12 Folder=username From=scanning To=idle Duration=00:00:02.2590000> 
2016-04-26 14:21:12.8883 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:21:12.8883 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=319 Time=26/04/2016 14:21:12 Folder=username From=idle To=syncing Duration=00:00:00> 
2016-04-26 14:21:12.9688 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:21:12.9688 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=320 Time=26/04/2016 14:21:12 Folder=username From=syncing To=idle Duration=00:00:00.0940000> 
2016-04-26 14:21:12.9913 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:21:12.9913 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <FolderSummary ID=321 Time=26/04/2016 14:21:12 Folder=username Summary=<FolderStatus GlobalBytes=4030809690 GlobalDeleted=1548 GlobalFiles=7356 LocalBytes=4030780634 LocalDeleted=1321 LocalFiles=7356 InSyncBytes=4030809690 InSyncFiles=7356 NeedBytes=0 NeedFiles=0 IgnorePattners=False, Invalid= State=idle StateChanged=26/04/2016 14:21:12 Version=1296261>> 
2016-04-26 14:21:12.9913 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 14:21:12.9913 #1588 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <GenericEvent ID=322 Type=FolderCompletion Time=26/04/2016 14:21:13 Data={"completion":100,"device":"<DEVICEID>","folder":"username"}> 

running SyncTrazor version 1.1.8.329 and syncthing v0.12.22, I tried going back to v0.12.21 as that was a recent change, but it has the same issue

I'm quite confused as I'm 100% sure this was working when testing SyncTrayzor and for the first dozen users rolled out, but now I'm seeing it when trying to copy or edit files on any device.

If I run Rescan on a device with changed or copied files, it picks them up and syncs them to the other device

@canton7
Copy link
Owner

canton7 commented Apr 26, 2016

Hrm, can't reproduce.

Didn't you change some details of how users' network shared were mapped? Could that be the cause?

@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

Yep that was me!

I don't think it is the drive mapping, I've tried making changes to the real location instead of the subst drive letter and it doesn't pick up the changes there either,

As I said I'm really confused by this as I'm sure it was working the only change I've made to the configuration is to change the folder path from the subst drive to the real path on the client end,

The server hasn't had any configuration changes and is exhibiting the same issue!

@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

Narrowed down a bit further - its not the creating a new file that the file system watcher picks up and starts the sync, its the rename function.

So it looks like only renaming a file is currently working on our system for the file system watcher!

canton7 added a commit that referenced this issue Apr 26, 2016
Must not hit production, as some of the properties being logged will throw exceptions
with long paths.

Related to #256
@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

Had a thought as well - the laptops I have to test at the moment have been recently reinstalled and will be ~3 months out of date for windows updates, which then apply at their leisure via SCCM.

Its possible that there is something in a .net framework update that could be related so I'm going to force all updates and see what happens!

@canton7
Copy link
Owner

canton7 commented Apr 26, 2016

I've created a version with some more logging here: https://ci.appveyor.com/project/canton7/synctrayzor/build/1.1.8.339/artifacts (it will be built in about 15 mins).

Probably not a good idea to run it everywhere - it won't support long paths - but it would be interesting to see if it prints anything on a test machine.

@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

No problem - I can run it on one test machine I have here and try the windows updates on the 2nd,

Thanks!

@canton7
Copy link
Owner

canton7 commented Apr 26, 2016

Had a thought as well - the laptops I have to test at the moment have been recently reinstalled and will be ~3 months out of date for windows updates, which then apply at their leisure via SCCM.

That doesn't match...

The server hasn't had any configuration changes and is exhibiting the same issue!

@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

Had a thought as well - the laptops I have to test at the moment have been recently reinstalled and will be ~3 months out of date for windows updates, which then apply at their leisure via SCCM.

That doesn't match...

The server hasn't had any configuration changes and is exhibiting the same issue!

Your right. I was just trying to think of any differences between my test machines and somehow forgot the server was doing the same, sorry! I'll run the debug version once its built!

@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

Oh, delete events are being picked up as well, I forgot to mention that,

Seem to be forgetting things too much today! Very Sorry!

@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

Here are the logs from the debug build:

2016-04-26 16:23:26.8687 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:26.868755 upnpservice.go:58: INFO: No UPnP device detected 
2016-04-26 16:23:41.6481 #2504 [Debug] SyncTrayzor.Services.FileWatcher: OnCreated. ChangeType=Created FullPath=c:\localdocs\usernamep\New Text Document.txt Name=New Text Document.txt 
2016-04-26 16:23:53.9420 #2504 [Debug] SyncTrayzor.Services.FileWatcher: OnRenamed. ChangeType=Renamed FullPath=c:\localdocs\usernamep\test.txt Name=test.txt OldFullPath=c:\localdocs\usernamep\New Text Document.txt OldName=New Text Document.txt 
2016-04-26 16:23:55.9856 #2504 [Info] SyncTrayzor.Services.DirectoryWatcher: Path Changed: c:\localdocs\usernamep\New Text Document.txt 
2016-04-26 16:23:56.0012 #2504 [Debug] SyncTrayzor.Syncthing.ApiClient.SyncthingApiClient: Scanning folder: usernamep subPath: New Text Document.txt 
2016-04-26 16:23:56.0324 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:56.032462 walk.go:100: DEBUG: Walk \\?\c:\localdocs\usernamep [] 131072 &{[] true 0xc083b50760 d41d8cd98f00b204e9800998ecf8427e 0xc08342a8a0 0xc082bc2e00} 
2016-04-26 16:23:56.0324 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:23:56.0505 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=31 Time=26/04/2016 16:23:56 Folder=usernamep From=idle To=scanning Duration=00:00:35.0800000> 
2016-04-26 16:23:56.0505 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:56.032462 walk.go:488: DEBUG: checkDir \\?\c:\localdocs\usernamep &{usernamep {17 {335832685 30515106} {2761762789 30515151} {2761762789 30515151} 0 65536} {0 0} \\?\c:\localdocs\usernamep 0 0 0} 
2016-04-26 16:23:56.0780 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:56.075563 walk.go:246: DEBUG: ignored: .stfolder 
2016-04-26 16:23:56.5148 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:56.514866 walk.go:235: DEBUG: temporary: My Music\~syncthing~Desktop.ini.tmp 
2016-04-26 16:23:56.5304 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:56.530466 walk.go:235: DEBUG: temporary: My Pictures\~syncthing~Desktop.ini.tmp 
2016-04-26 16:23:56.5304 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:56.530466 walk.go:235: DEBUG: temporary: My Video\~syncthing~Desktop.ini.tmp 
2016-04-26 16:23:57.0764 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.076469 walk.go:235: DEBUG: temporary: my settings\OneNote\15.0\Backup\My Notebook\~syncthing~~A-Line(nst).one.onebackupconstruction.tmp 
2016-04-26 16:23:57.0764 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.076469 walk.go:235: DEBUG: temporary: my settings\OneNote\15.0\Backup\My Notebook\~syncthing~~F-Line.one.onebackupconstruction.tmp 
2016-04-26 16:23:57.1076 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.107669 walk.go:235: DEBUG: temporary: my settings\OneNote\15.0\Backup\Work Notebook\~syncthing~~A2 Decision.one.onebackupconstruction.tmp 
2016-04-26 16:23:57.1232 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.107669 walk.go:235: DEBUG: temporary: my settings\OneNote\15.0\Backup\Work Notebook\~syncthing~~AS 'D'.one.onebackupconstruction.tmp 
2016-04-26 16:23:57.1232 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.107669 walk.go:235: DEBUG: temporary: my settings\OneNote\15.0\Backup\Work Notebook\~syncthing~~AS Further.one.onebackupconstruction.tmp 
2016-04-26 16:23:57.1388 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.107669 walk.go:235: DEBUG: temporary: my settings\OneNote\15.0\Backup\Work Notebook\~syncthing~~AS STATS 2011-12.one.onebackupconstruction.tmp 
2016-04-26 16:23:57.1388 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.107669 walk.go:235: DEBUG: temporary: my settings\OneNote\15.0\Backup\Work Notebook\~syncthing~~AS'E'.one.onebackupconstruction.tmp 
2016-04-26 16:23:57.1544 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.107669 walk.go:235: DEBUG: temporary: my settings\OneNote\15.0\Backup\Work Notebook\~syncthing~~FUR.Maths.one.onebackupconstruction.tmp 
2016-04-26 16:23:57.3310 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.331071 walk.go:304: DEBUG: rescan: File{Name:"", Flags:00, Modified:0, Version:[], Size:0, Blocks:[]} 1461684221 -rw-rw-rw- 
2016-04-26 16:23:57.3541 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.331071 walk.go:319: DEBUG: to hash: test.txt File{Name:"test.txt", Flags:0644, Modified:1461684221, Version:[{2DSOSWW 1}], Size:0, Blocks:[]} 
2016-04-26 16:23:57.3541 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:23:57.3541 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.336071 walk.go:189: DEBUG: real to hash: test.txt 
2016-04-26 16:23:57.3541 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <LocalIndexUpdated ID=32 Time=26/04/2016 16:23:57 Folder=usernamep Items=1 Version=10499> 
2016-04-26 16:23:57.3853 #2504 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [2DSOS] 2016/04/26 16:23:57.338571 walk.go:167: DEBUG: Walk progress done \\?\c:\localdocs\usernamep [] 131072 &{[] true 0xc083b50760 d41d8cd98f00b204e9800998ecf8427e 0xc08342a8a0 0xc082bc2e00} 
2016-04-26 16:23:58.1273 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:23:58.1273 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <RemoteIndexUpdatedEvent ID=33 Time=26/04/2016 16:23:58 Device=<SERVERDEVICEID> Folder=usernamep Items=1> 
2016-04-26 16:23:58.5210 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:23:58.5210 #2504 [Warn] SyncTrayzor.Syncthing.ApiClient.SyncthingHttpClientHandler: Null response received from https://localhost:8384/rest/db/scan?folder=usernamep&sub=New+Text+Document.txt. StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Access-Control-Allow-Origin: *
  Pragma: no-cache
  X-Syncthing-Id: <CLIENTDEVICEID>
  X-Syncthing-Version: v0.12.22
  Cache-Control: no-store, no-cache, max-age=0
  Date: Tue, 26 Apr 2016 15:23:58 GMT
  Content-Length: 0
  Content-Type: text/plain; charset=utf-8
  Expires: Tue, 26 Apr 2016 15:23:56 GMT
}. Content (again): System.Threading.Tasks.Task`1[System.String] 
2016-04-26 16:23:58.5366 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:23:58.5210 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=34 Time=26/04/2016 16:23:58 Folder=usernamep From=scanning To=idle Duration=00:00:02.4890000> 
2016-04-26 16:23:58.5366 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=35 Time=26/04/2016 16:23:58 Folder=usernamep From=idle To=syncing Duration=00:00:00> 
2016-04-26 16:23:58.5522 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:23:58.5522 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=36 Time=26/04/2016 16:23:58 Folder=usernamep From=syncing To=idle Duration=00:00:00.0160000> 
2016-04-26 16:23:58.5990 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:23:58.5990 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <FolderSummary ID=37 Time=26/04/2016 16:23:58 Folder=usernamep Summary=<FolderStatus GlobalBytes=4149980321 GlobalDeleted=1623 GlobalFiles=7420 LocalBytes=4149951521 LocalDeleted=1398 LocalFiles=7420 InSyncBytes=4149980321 InSyncFiles=7420 NeedBytes=0 NeedFiles=0 Invalid= State=idle StateChanged=26/04/2016 16:23:58 Version=1299134>> 
2016-04-26 16:23:58.6302 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:23:58.6458 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <GenericEvent ID=38 Type=FolderCompletion Time=26/04/2016 16:23:58 Data={"completion":100,"device":"<SERVERDEVICEID>","folder":"usernamep"}> 
2016-04-26 16:24:16.8504 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:24:16.8816 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <GenericEvent ID=39 Type=Ping Time=26/04/2016 16:24:16 Data=null> 
2016-04-26 16:24:20.5434 #2504 [Debug] SyncTrayzor.Services.FileWatcher: OnCreated. ChangeType=Created FullPath=c:\localdocs\usernamep\Zoe ROBB - Copy.docx Name=Zoe ROBB - Copy.docx 
2016-04-26 16:25:16.8553 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:25:16.8709 #2504 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <GenericEvent ID=40 Type=Ping Time=26/04/2016 16:25:16 Data=null> 

I can see OnCreated events firing but nothing happening with them? The OnRenamed event seems to fire the syncthing.apiclient routine?

@canton7
Copy link
Owner

canton7 commented Apr 26, 2016

Let's see...

There's an amount of dead time between receiving the notification and telling Syncthing about it: during this period, we'll take potentially many notifications and reduce them to a single (parent) path. This is to avoid spamming Syncthing if there are many notifications in quick succession.

So it actually looks like it's ignoring the OnRenamed notification

canton7 added a commit that referenced this issue Apr 26, 2016
@canton7
Copy link
Owner

canton7 commented Apr 26, 2016

Here's another build with loads more logging: https://ci.appveyor.com/project/canton7/synctrayzor/build/1.1.8.340/artifacts

@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

Right! I'm leaving work in ~15 mins, if it builds and is available I'll try and test is quickly to get the logs over to you!

Thanks again! My colleagues are commenting about how well you are supporting the app, better than any of our software support contacts! :)

@canton7
Copy link
Owner

canton7 commented Apr 26, 2016

Thanks 😄

@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

got it!

case sensitivity issue!

2016-04-26 16:56:12.3229 #3232 [Debug] SyncTrayzor.Services.FileWatcher: OnCreated. ChangeType=Created FullPath=c:\localdocs\mulveep\New Text Document.txt Name=New Text Document.txt 
2016-04-26 16:56:12.3249 #3232 [Debug] SyncTrayzor.Services.FileWatcher: RecordPathChange: path=c:\localdocs\mulveep\New Text Document.txt pathExists=True 
2016-04-26 16:56:12.3400 #3232 [Debug] SyncTrayzor.Services.FileWatcher: RecordPathChanged: long path name = c:\localdocs\MULVEEP\New Text Document.txt 
2016-04-26 16:56:12.3400 #3232 [Warn] SyncTrayzor.Services.FileWatcher: Ignoring path c:\localdocs\MULVEEP\New Text Document.txt as it does not start with c:\localdocs\mulveep\ 

or not? just a warning, maybe jumped to conclusions as the same warn is present in the rename log! :(

though it does seem to stop right after the warning, whereas the rename continues?

2016-04-26 16:56:45.1447 #3232 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 1 events 
2016-04-26 16:56:45.1603 #3232 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <GenericEvent ID=37 Type=Ping Time=26/04/2016 16:56:45 Data=null> 
2016-04-26 16:57:21.3275 #3232 [Debug] SyncTrayzor.Services.FileWatcher: OnRenamed. ChangeType=Renamed FullPath=c:\localdocs\mulveep\test.txt Name=test.txt OldFullPath=c:\localdocs\mulveep\New Text Document.txt OldName=New Text Document.txt 
2016-04-26 16:57:21.3505 #3232 [Debug] SyncTrayzor.Services.FileWatcher: RecordPathChange: path=c:\localdocs\mulveep\test.txt pathExists=True 
2016-04-26 16:57:21.3625 #3232 [Debug] SyncTrayzor.Services.FileWatcher: RecordPathChanged: long path name = c:\localdocs\MULVEEP\test.txt 
2016-04-26 16:57:21.3745 #3232 [Warn] SyncTrayzor.Services.FileWatcher: Ignoring path c:\localdocs\MULVEEP\test.txt as it does not start with c:\localdocs\mulveep\ 
2016-04-26 16:57:21.3885 #3232 [Debug] SyncTrayzor.Services.FileWatcher: RecordPathChange: path=c:\localdocs\mulveep\New Text Document.txt pathExists=False 
2016-04-26 16:57:21.3885 #3232 [Debug] SyncTrayzor.Services.FileWatcher: RecordPathChanged: long path name = c:\localdocs\mulveep\New Text Document.txt 
2016-04-26 16:57:21.4005 #3232 [Debug] SyncTrayzor.Services.FileWatcher: RecordPathChanged: subPath=New Text Document.txt 
2016-04-26 16:57:21.4005 #3232 [Debug] SyncTrayzor.Services.FileWatcher: RecordPathChanged: subPath afer stripping short path segments=New Text Document.txt 
2016-04-26 16:57:21.4005 #3232 [Debug] SyncTrayzor.Services.FileWatcher: RecordPathChanged: isDirectory=True 
2016-04-26 16:57:21.4205 #3232 [Debug] SyncTrayzor.Services.DirectoryWatcher: OnPathChanged: subPath=New Text Document.txt pathExists=False isDirectory=True 
2016-04-26 16:57:21.4205 #3232 [Debug] SyncTrayzor.Services.DirectoryWatcher: OnPathChanged: currentNotifyingSubPath was  
2016-04-26 16:57:21.4345 #3232 [Debug] SyncTrayzor.Services.DirectoryWatcher: OnPathChanged: currentNotifyingSubPath is now New Text Document.txt 
2016-04-26 16:57:23.4497 #3232 [Info] SyncTrayzor.Services.DirectoryWatcher: Path Changed: c:\localdocs\mulveep\New Text Document.txt 
2016-04-26 16:57:23.4697 #3232 [Debug] SyncTrayzor.Syncthing.ApiClient.SyncthingApiClient: Scanning folder: mulveep subPath: New Text Document.txt 

There is a LOT more log, I've just taken the snippit before it calls the apiclient, I can upload the rest if needs be

@canton7
Copy link
Owner

canton7 commented Apr 26, 2016

Bleh. Thanks for helping track this down!

@canton7
Copy link
Owner

canton7 commented Apr 26, 2016

This should fix it: https://ci.appveyor.com/project/canton7/synctrayzor/build/1.1.8.341. Please let me know if it doesn't (not today, of course), and I'll include it in the next release otherwise.

canton7 added a commit that referenced this issue Apr 26, 2016
@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

No problem!

Looks like we did hit the issue when I changed from the subst drive (N:) to c:\localdocs\username after all, so I was right that it was working when testing previously! :)

Will test first thing tomorrow,

Thanks for looking into it so quickly!!

@sfcmgr
Copy link
Author

sfcmgr commented Apr 26, 2016

One question - does build 341 contain the extra debugging which will cause long paths to fail? or has that been removed and if it does fix I can use as a general build?

@canton7
Copy link
Owner

canton7 commented Apr 26, 2016

No, it doesn't.

One question: what's the actual casing of usernamep? I.e. if you view the folders in c:\localdocs\, does it show usernamep or USERNAMEP? I'm trying to work out why its case is being changed.

@sfcmgr
Copy link
Author

sfcmgr commented Apr 27, 2016

The folder is c:\LocalDocs\MULVEEP and the path in syncthing config.xml is c:\localdocs\mulveep

I'm not actually sure why the username is in all caps, it uses %username% in the subst command to create the folder, though that is in lowercase if I echo %username% in the command prompt and the actual user in AD is in CamelCase! It might be some quirk of the user management software we use to deliver the drive mappings and other settings (RES Workspace)

The LocalDocs to localdocs is changes in my coding practice - powershell I wrote 2 years ago to create the folder and permissions I would use CamelCase, to powershell I wrote a few weeks ago to configure syncthing as I keep everything lowercase now.

@sfcmgr
Copy link
Author

sfcmgr commented Apr 27, 2016

quick test and seems to be working! creating files, adding content to files and copying files are now all being picked up by the filewatcher and being synced in realtime again!

So looks good!

Thank you very much! :)

@canton7
Copy link
Owner

canton7 commented Apr 27, 2016

Great, that explains it, thanks. We established a watcher at c:\localdocs\mulveep because that's the path that Syncthing gave us, so we got change notifications for paths beginning with c:\localdocs\mulveep. However, when we can (i.e. when we know a path still exists and hasn't been deleted) we try and expand short paths (PROGRA~1, etc), and this had the side-effect of restoring the path to its proper case (c:\LocalDocs\MULVEEP). This then got caught in case-sensitivity fun, as you discovered. It also explains why some change notifications were unaffected.

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

This might not be related, but we are seeing this popping up in the logs quite regularly,

[X7RFW] 11:04:55 INFO: Puller (folder "username", file "My Settings\\links\\Downloads.lnk"): pull: peers who had this file went away, or the file has changed while syncing. will retry later
[X7RFW] 11:04:55 INFO: Puller: final: peers who had this file went away, or the file has changed while syncing. will retry later
[X7RFW] 11:04:55 INFO: Folder "username" isn't making progress. Pausing puller for 1m0s.

so far its been for unimportant files like shortcuts or desktop.ini (which we've now excluded from syncing) but I wanted to mention it as it seems like the index is not up to date as to fix it we run a rescan on the other connected node and the number of files increases and the error goes away from the remote node,

I have both nodes running 1.1.8.341 with the case fix included, these are new shared folders created after updating synctrayzor

I was going to put this as a new issue, but I have a slight feeling that maybe somehow these changes are not getting sent to syncthing to update its index. I've left one broken, we have syncthing configured to rescan once per hour so I'm going to check to see if that fixes it when it rescans on its own,

Sorry!

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

These files are being changed as there is an active session on both sides of the sync,

Wouldn't Syncthing tell me its working as intended? As the sync is working after a rescan on a node, which is their normal behaviour without a file watcher?

It could be an artifact of the inital sync, while its downloading ~5gb the files have changed before it gets to them? But shouldn't that be picked up by the file watcher to tell syncthing to update its index? Somehow the index is out of date?

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

If they're being constantly changed, then this is expected behaviour from Syncthing: by the time the pulling side gets around to requesting the file, it's changed.

I'm not sure whether Syncthing will listen for updates to the index while downloading files from it - I rather suspect it won't.

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

I'm not sure whether Syncthing will listen for updates to the index while downloading files from it - I rather suspect it won't.

That's what I was wondering about, it was my suspicion too based on the behaviour observed that the file watcher was telling Syncthing that a change had happened, but it was busy - as the button for rescan is disabled when in the Out-of-sync status, so I thought perhaps it couldn't accept an api request for a rescan while in that status either?

Do you get a meaningful response from the api when requesting a rescan on a file / folder, actually telling you its going to do it, or can't at that time? Or just a successfully sent api request but no status?

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

Or just a successfully sent api request but no status?

This

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

There's been a lot of work recently on partial indexes, so a change to this behaviour may already be in the pipeline.

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

Or just a successfully sent api request but no status?
This

Thought this was the most likely case!

There's been a lot of work recently on partial indexes, so a change to this behaviour may already be in the pipeline.

Ah yes, there's big changes in 0.13, not really in a place for me to use live yet but I'll check that when its out of beta,

If there is no status reported back from syncthing then there's nothing to work with if it ignores api calls from the file watcher and it will just have to find any missing changes during the hourly rescan (2m+ files 2.5TB in 250+ folders on the server, so frequent scanning causes pretty big io bottlenecks!). I can't imagine its actually going to happen very often in day to day operation on real files, just during the first time sync,

Thanks again!

@AudriusButkevicius
Copy link

AudriusButkevicius commented Apr 28, 2016

Nothing has changed in terms of scanning in next release. I think scanning requests should block while there is one already running.

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

So we'll probably have the same issue in 0.13 - is it worth putting in a feature request to Syncthing to report a status when the api rescan request is blocked? Filewatcher implementations could then queue changes to post to the api?

Unfortunately my go knowledge is next to non-existent so contributing it myself would be extremely hard :(

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

I'm still not clear on what exactly is going on here - are you sending a rescan request to a Syncthing instance which is downloading, or one which idle but has another device downloading from it?

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

Sorry if I'm not being clear enough!

We have 2 nodes with 1 folder shared between them running synctrayzor

The node on our server is set up first and contains the users personal files and documents, and is fully indexed by syncthing

We then log into the users laptop and start synctrayzor which begins to download the folder from the server node,

Once the laptop has completed the sync we then get the error about peers going away until a rescan is performed on the server node,

Does that make sense?

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

Right, so while the server is idle and the client is downloading, a file changes on the server. This change is not picked up on the server (until you rescan). Correct?

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

Almost - The user is logged with a drive mapped to the files on the server, while the client is downloading, which is why files change on the server while the client is downloading, but the index is up to date before we start the client and Syncthing is not scanning

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

Wait, you didn't mention that before - that's new.

What exactly is going? So there's a folder on the server, which is added to Syncthing as a folder. When a user logs in on a different machine, that folder gets mapped as a network drive, but the user also has Syncthing set up, and has that network drive added as a folder within Syncthing?

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

OK, so we have a server that contains user home drives -

these are mapped to a drive when the user logs into a network computer
when logging into their personal laptop that drive is instead mapped to a local folder

SyncTrayzor is running on the server and has the home drive folder which is local to the server added to Syncthing's config
SyncTrayzor is also running on the personal laptop and syncs the folder from the server node to the local folder used in the remapping above

Syncthing is working in a normal fashion as its syncing a real folder on a device to a real folder on a device, there are no network folders configured in syncthing,

It should be the same as using syncthing on a NAS with a drive mapped to a PC while also running syncthing on a laptop, which is why I didn't really go over the setup in detail, sorry again!

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

Right, thanks for clearing that up.

So my general description before was correct: the server is idle, and is notified of a change while another device is downloading. The other device does not pick up on that change until the server is manually rescanned.

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

In other words, this:

That's what I was wondering about, it was my suspicion too based on the behaviour observed that the file watcher was telling Syncthing that a change had happened, but it was busy - as the button for rescan is disabled when in the Out-of-sync status

Is not relevant: the server's Rescan button is not disabled, because the server is idle.

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

yes, I interpreted idle as there was no user access to the files!

Whoops!

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

Is not relevant: the server's Rescan button is not disabled, because the server is idle.

You know, I've not actually looked at the server folder status until after the download has finished and the error pops up - I'l have to check that on the next one I do,

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

OK, so all of the assertions that the server is idle when the change notification from SyncTrayzor arrives aren't actually substantiated?

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

OK, so all of the assertions that the server is idle when the change notification from SyncTrayzor arrives aren't actually substantiated?

Quite possible actually - As the initial adding of the folder, first scan and logging into the laptop and its syncing all took place within an hour (which is the rescan interval) I assumed the server status didn't change,

Next one I do I'll watch the server side as well as the client and see what happens.

The server does have other users folders configured as well, thinking about how I worded earlier it might be assumed its a single folder on the server, whereas its 1-1 relationship for folders, which contain the server node and the client node, but the server config contains the other users folders as well - though it shouldn't make a difference if another folder is scanning when you call for a scan on an idle folder right?

Sorry about this,

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

What I need to know is: When SyncTrayzor sends a "file changed" notification for a folder to Syncthing, what state is that folder within the Syncthing GUI?

@sfcmgr
Copy link
Author

sfcmgr commented Apr 28, 2016

I can watch that on the next one - any change should happen in the GUI even if its very quick, right?

@canton7
Copy link
Owner

canton7 commented Apr 28, 2016

You misunderstand: I don't want to know if SyncTrayzor's "file changed" notification triggers a change in the Syncthing GUI, I want to know whether the folder is Idle/Syncing/Scanning/Whatever at the point that SyncTrayzor sends its "file changed" notification.

@sfcmgr
Copy link
Author

sfcmgr commented Apr 29, 2016

We've set up 2 more laptops since my last message,

The first didn't exhibit the problem at all
The second had the error message for peers went away during the sync, but went away by itself after the initial sync completed,

During the client download the server status changes to Syncing a few times, checking the synctrayzor log file for file watcher events its a bit too quick to see - so I've recorded the log + syncything GUI so I can play back and catch the events and we can see what the status is when SyncTrayzor triggers a rescan

I did notice though that the files or the folders which contain them which had the peers went away error are not listed in any of the watcher or api calls

I'll keep logging new installs to try and find one which has the same persistent problem as I found previously

@sfcmgr
Copy link
Author

sfcmgr commented May 3, 2016

I managed to capture one this morning,

The syncthing GUI reads "Up to Date", switching to "Syncing" or "Syncing (100%)" there is a ~100ms delay between the GUI changing and my live log viewer changing, the GUI updates first. The live log viewer has a 500ms update check by default, so I'm pretty sure that the GUI is changing as a result of the synctrayzor call. I could try and shorten the polling time if you think the accuracy is an issue.

The server log is filtered for lines containing the foldername I'm syncing - otherwise its impossibly big and extremely hard to find relevant information, I don't know if this causes any issues if you have any log entries which don't contain the foldername

I can find the time of the logs though and provide the full ones if needed.

The server has this log during the sync (log is pretty log so I've popped it on pastebin for a week)

http://pastebin.com/L8xGmsCh

The error on the client disappeared after this happened on the server:

2016-05-03 11:37:21.4296 #5556 [Info] SyncTrayzor.Services.DirectoryWatcher: Path Changed: E:\Work\willenbrocka\ 
2016-05-03 11:37:21.4296 #5556 [Debug] SyncTrayzor.Syncthing.ApiClient.SyncthingApiClient: Scanning folder: willenbrocka subPath:  
2016-05-03 11:37:21.4296 #5556 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=5502 Time=03/05/2016 11:37:21 Folder=willenbrocka From=idle To=scanning Duration=00:14:26.4960000> 
2016-05-03 11:37:22.9747 #5556 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <LocalIndexUpdated ID=5503 Time=03/05/2016 11:37:22 Folder=willenbrocka Items=4 Version=1447490> 
2016-05-03 11:37:23.2542 #5556 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=5504 Time=03/05/2016 11:37:23 Folder=willenbrocka From=scanning To=idle Duration=00:00:01.8250000> 
2016-05-03 11:37:23.3323 #5556 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <RemoteIndexUpdatedEvent ID=5505 Time=03/05/2016 11:37:23 Device=UVYNR2C-BUN6GAN-MTOYD2J-BIK2QHN-DLU4K2T-N6BKANX-U5PJS5C-CSB7EAC Folder=willenbrocka Items=4> 
2016-05-03 11:37:23.3480 #5556 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=5506 Time=03/05/2016 11:37:23 Folder=willenbrocka From=idle To=syncing Duration=00:00:00.0630000> 
2016-05-03 11:37:23.4261 #5556 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <StateChangedEvent ID=5507 Time=03/05/2016 11:37:23 Folder=willenbrocka From=syncing To=idle Duration=00:00:00.0940000> 
2016-05-03 11:37:23.4261 #5556 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <FolderSummary ID=5508 Time=03/05/2016 11:37:23 Folder=willenbrocka Summary=<FolderStatus GlobalBytes=1419689665 GlobalDeleted=2 GlobalFiles=7062 LocalBytes=1419689665 LocalDeleted=2 LocalFiles=7062 InSyncBytes=1419689665 InSyncFiles=7062 NeedBytes=0 NeedFiles=0 Invalid= State=idle StateChanged=03/05/2016 11:37:23 Version=1454555>> 
2016-05-03 11:37:23.4261 #5556 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <GenericEvent ID=5509 Type=FolderCompletion Time=03/05/2016 11:37:23 Data={"completion":100,"device":"UVYNR2C-BUN6GAN-MTOYD2J-BIK2QHN-DLU4K2T-N6BKANX-U5PJS5C-CSB7EAC","folder":"willenbrocka"}> 

The client first see's the peers went away error here:

2016-05-03 11:19:43.4808 #1160 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 2 events 
2016-05-03 11:19:43.4808 #1160 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <ItemStarted ID=3441 Time=03/05/2016 11:18:53 Item=Downloads\$RECYCLE.BIN\$IF0F8MU.ppt Folder=willenbrocka Type=File Action=Update> 
2016-05-03 11:19:43.4948 #1160 [Debug] SyncTrayzor.Syncthing.TransferHistory.SyncthingTransferHistory: Item started. Folder: willenbrocka, Item: Downloads\$RECYCLE.BIN\$IF0F8MU.ppt, Type: File, Action: Update 
2016-05-03 11:19:43.4948 #1160 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 4 events 
2016-05-03 11:19:43.5148 #1160 [Debug] SyncTrayzor.Syncthing.TransferHistory.SyncthingTransferHistory: Created file transfer: <FileTransfer Folder=willenbrocka Path=Downloads\$RECYCLE.BIN\$IF0F8MU.ppt Status=Started ItemType=File ActionType=Update Started=03/05/2016 10:19:43 Finished=> 
2016-05-03 11:19:43.5268 #1160 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: <ItemFinished ID=3442 Time=03/05/2016 11:18:54 Item=Downloads\$RECYCLE.BIN\$IVD304F.pdf Folder=willenbrocka Error=> 
2016-05-03 11:19:43.5268 #1160 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 6 events 
2016-05-03 11:19:43.5268 #1160 [Debug] SyncTrayzor.Syncthing.SyncthingProcessRunner: [UVYNR] 11:19:43 INFO: Puller (folder "willenbrocka", file "My Settings\\links\\Downloads.lnk"): pull: peers who had this file went away, or the file has changed while syncing. will retry later 
2016-05-03 11:19:43.5528 #1160 [Debug] SyncTrayzor.Syncthing.EventWatcher.SyncthingEventWatcher: Received 2 events 
2016-05-03 11:19:43.5528 #1160 [Debug] SyncTrayzor.Syncthing.TransferHistory.SyncthingTransferHistory: Item finished. Folder: willenbrocka, Item: Downloads\$RECYCLE.BIN\$IVD304F.pdf, Type: File, Action: Update 

@canton7
Copy link
Owner

canton7 commented May 3, 2016

Right, so SyncTrayzor is definitely telling Syncthing that the file has changed, and Syncthing is picking up on that change. Syncthing is not scanning (or doing anything else) when the change notification happened.

Therefore whatever's going on is entirely a Syncthing issue. Please open an issue with Syncthing, describing the problem in full detail (I'm still a bit unclear on what exactly is happening - the story appears to have changed a few times).

@canton7
Copy link
Owner

canton7 commented May 3, 2016

Fixed in v1.1.9

@canton7 canton7 closed this as completed May 3, 2016
@sfcmgr
Copy link
Author

sfcmgr commented May 4, 2016

Thanks for all the extended checking, sorry I wasn't so clear at some points,

I'll open an issue with Syncthing as you suggested,

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants