"file changed during hashing"

I have Syncthing running on two ubuntu 20.04 machines. When I copy a “big” (2GB) file into the Syncthing folder on one machine, I can see in `journactl -fu Syncthing…" that it notices the new files, and it starts to hash them, but then I get “file changed during hashing”. It looks to me like it just gives up at that point, and those big files are never synced.

Is that the expected behavior? Should it not retry? Restarting the service makes it finally share the files, but it reliably happens with bigger files that are not copied in an instant.

It should indeed retry, next time it does a scan.

Ok. For that particular shared folder I have set “fsWatcherDelayS” to 1. That’s probably why it’s happening more likely for large files.

However, in Syncthing Configuration — Syncthing v1 documentation I cannot find anything that controls how soon it retries. It doesnt retry files that are blocked because of “file changed during hashing” specifically, it only just does the periodic generic full rescan? Is that what you are talking about?

Yes, there’s no “sped-up” retrying of scan errors. It gets scanned whenever another scan occurs, be that due to the watcher, a periodic or a manual scan. For a file that changed during scanning, it will be rescanned immediately with the watcher enabled, because whatever changed it also triggered a watcher event.

The event based triggering might not “work” though, because we’ll get an event and start scanning (which takes a while), and while scanning we ignore further change events (I think?). Then when we’re done we notice it changed in the meantime and the scan failed, but the copy might be done and we’re not getting any more events on it. So it’ll get picked up at the next full scan in an hour or so…

Afaik we do ignore watcher events while a sync is in progress, but not while scanning.

1 Like

Thanks, appreciate the explanations. Would that be worth a bug or feature request? In the meantime my best bet is probably a shorter full-rescan timeout for that folder.

It sounds to me like it’s working as intended more or less?

1 Like

I’ve had encountered the same type of errors, but in my case the files did continue to sync immediately after they became available. The “file changed during hashing” error state only lasted a few seconds at most. This was with much smaller text files and under Windows though.

Just for the record, as this is Ubuntu, which versions of Syncthing are you running in there?

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