I have Syncthing installed on my Synology NAS server, and I synchronize photos (and other data) from mobile phones and other devices. The synchronization is uni-directional: phone -> NAS (receive-only, ignore delete).
There are two common situations when Syncthing unnecessarily reports “locally changed items”. Is there a way to “accept local changes” instead of “revert local changes”?
Once a while (on NAS) I move the synchronized photos from Syncthing folders to photo folders where I sort them out. Syncthing then signals “locally changed items” in the Syncthing folder (referring to the deleted files), and offers a red button to revert the changes back.
I had an old mobile phone from which I used to synchronize photos to NAS. Recently I replaced the old phone with a new phone and set up synchronization of photos to the same Syncthing folder as before. Now, Syncthing (on NAS) shows status of the new device (i.e. of the new phone) permanently as “Syncing, 3%, 8GiB”. And shows that there are plenty of “out-of-sync items”. These are those photos that were synchronized from the old phone, and were never synchronized to the new phone.
As the synchronization is set up as one-way, there’s no reason why Syncthing should report local changes at NAS. Is there an easy way how to tell Syncthing that these local changes are to be accepted? I tried --reset-database with --reset-deltas, but without success.
Well, SendReceive could help, that’s a good idea. In this case, I think it wouldn’t make any harm when I allow the synchronization from server to phones.
I wanted to avoid synchronizations from server to phones in order to prevent reappearance of photos already deleted from the phone. But as the folders at the server do not contain all photos, only those that have been already synchronized from that particular phone, bi-directional synchronization (with “ignore delete”) might work.
After allowing bi-directional synchronization both on my phone and the NAS server, I’ve got to another problem - the Syncthing folder on NAS became out-of-sync. It shows there are thousands of out-of-sync items with total size 0B. When I click on the detail of the out-of-sync items, it shows a dialog with 200 pages, but each page is empty (no item is shown there)!?!
–reset-dictionary didn’t help.
Is there any help that describes how to handle various synchronization errors?
As far as I understand Syncthing, there are several places in the Syncthing chain where out-of-sync may happen:
When I modify the files, the Syncthing folder gets out-of-sync with locally-changed items. And if the folder is “receive only”, it stays out-of-sync.
When the Syncthing folder is not “receive only”, it passes the out-of-sync items for synchronization to the Syncthing remote devices. The Syncthing folder gets up-to-date, but the Syncthing remote devices get out-of sync. Until the Syncthing device is synchronized with Syncthing on the real remote device, it will stay out-of sync.
3., 4. the same problems may happen upon retrieval. But I do not understand this part. And this is probably what happened in my case.
Did you ignore permissions on Synology? Permissions are royally borked on Synology so it’s best to ignore there (I am negatively biased towards Synology in general, but I believe that statement is fair).
And out of sync items with nothing displayed in the opened list definitely sounds wrong. Can you post a screenshot for starters.
Since its creation, this folder at NAS was receive-only with ignore-delete, and its counterpart in the phone was “sent-only”. The synchronization was set up more than a year ago, and was used the way I described in the scenario 1.
That is, new photos were synced from the phone to NAS, and from time to time I moved the synced photos from the Syncthing folder at NAS to a photo folder. From the Syncthing perspective the files were deleted. This worked fine until yesterday, when I changed the unidirectional synchronization to bidirectional. Immediately, the Syncthing folder at NAS became out-of-sync with the problems we’re just talking about. In the phone, however, the folder looks synchronized.
Hm, --reset-database doesn’t work, on NAS. I stopped syncthing and executed
and syncthing silently exited. I hoped it did its work, but evidently it didn’t. According to Effect of parameter | -reset-database // -reset-deltas, this command should remove the folder /var/packages/syncthing/target/var/index-v0.14.0.db/, but it did not :-(. Can I remove the folder manually?
When I executed
syncthing started and - according to its log - it performed what it was expected to do.
At the end it was for me also the best to stop Syncthing, delete the content of the folder index-v0.14.0.db and start Syncthing again. This I make with all devices, it means Synologys, Windows, so it was clean. Since this point all is running without problems.
Also one productive NAS with Kastelo installation and update from v1.3.4 to now v1.4.0 works without any problems. The migration was without faults.
@AudriusButkevicius No. In other theads they advise to perform --reset-database which usually resolves all problems. As this command didn’t do anything in my instalation, I did that manually. I was consulting that with @imsodin and @Andy, and they didn’t advise me not to do that. So no random things.
Plenty people struggle - see the forum - with situations when Syncthing gets out-of-sync. In my opinion, there’s missing a comprehensive help that would instruct users what to do when this problem occurs for them. Out-of-sync may occur at various places - at sender or receiver, in folder or device. And all these variants ahould be handled in the help.
True, it’s definitely too omnipresent at the moment. However I did actually ask you whether you did reset the db and when - I did not tell you to do it now. I do however get how you got the impression that it is a good idea to do it now. And it’s not that bad, we can take it from here too.
There’s no comprehensive help other than docs.syncthing.net (which has a lot of useful, but admittedly also some missing/outdated info), because it shouldn’t occur. What we are doing here is debugging a problem, that should lead to finding the bug and fixing it, such that you and everyone else don’t encounter it anymore.
So right now please post the requested information and we will try to figure out what’s going on.
The remote devices connect to NAS every several minutes, they are not connected permanently. While I was deleting the index, Syncthing was stopped, then I started it again, and it automatically started scanning everything. And remote devices started to connect.
The locally changed items do not exist at NAS. Syncthing reports size 0B for some of them, for others it reports its actual size before deleting. These files are not present at the remote device.
For the out-of-sync items I cannot say, as Syncthing doesn’t display the list. But as it displays the total size 0B, I think they are also the deleted files.
The 0 bytes ones are placeholders like .nomedia, they really are 0 bytes. And many of them are hidden files (starting with a dot) - did you check for that? If in doubt post the output of ls -la from one of the paths (e.g. just Helium).
There’s any way something wrong with the out of sync files not being displayed, no idea what from the top of my head. To get an understanding of the actual sync situation, please also post screenshots of the folder from the remote.
In my post at 12:11, in the third point, I said that - after index reset - some of the out-of-thing items moved from the out-of-sync folder to the corresponding device. Actually, these are the files that have been deleted from the remote device (the phone) but remained at NAS. After index reset, NAS wants to synchronize these files back to the phone, but this sync fails due to some problems at the phone side (“Your android version only grants Syncthing readonly access to the folder”, which prevents me to change the folder type to send-receive). Hence, the out-of-sync of this device is an expected behaviour. The phone shows exactly the same number and size of unsynchronized items as NAS.
I have to find a way how to allow write-access for Syncthing in the phone, but I think this is not related to the problems above. (The Android app is given Read/Write access to external storage, but still reports insufficient privileges.)
That doesn’t help, this is a known limitation of android. However I believe your android is set to send-only, so you can press the override button there to force it’s state on the NAS (that will make the NAS identical to the phone, i.e. also delete anything the NAS has but the phone does not).