How to accept local changes

IssueD: The documentation says that

ignoreDelete is an advanced folder setting that affects the handling of incoming index updates. When set, incoming updates with the delete flag set are ignored.

I still don’t see what you meant when you wrote:

That’s not how it works. That’s why it’s an advanced setting, it is just a workaround with the drawback you see.

How does it differ from what I described?

IssueC:

>curl -H "X-API-Key: XXXXXXXXXXX" http://192.168.28.2:8384/rest/db/file?folder=xyzwv-pqrst&file=Helium/me.bluemail.mail/me.bluemail.mail.sync-conflict-20200318-115750-BTX3SK4.ab
No such object in the index
file: could not find any magic files!

>curl -H "X-API-Key: XXXXXXXXXXXX" http://192.168.28.2:8384/rest/db/file?folder=abcde-fghij&file=DOS/CARPET2/CARPET2.BAT
No such object in the index
file: could not find any magic files!

The tested files are listed in the picture:

The pasted code has no single quotes around the url.

Part of what you saw (local out of sync items) was a bug, that’s going to be fixed (if you’d rather not open the issue yourself, please say so and I’ll do it). However the remote will still show the NAS as out of sync, because it ignores the deletions.

I created the bug for the issues A and B: #6430

1 Like

Double-quotes were missing:

>curl -H "X-API-Key: XXXXXXXX" "http://192.168.28.2:8384/rest/db/file?folder=xyzwv-pqrst&file=Helium/me.bluemail.mail/me.bluemail.mail.sync-conflict-20200318-115750-BTX3SK4.ab" 
{                                                                                                                                                                                                               
  "availability": null,                                                                                                                                                                                         
  "global": {                                                                                                                                                                                                   
    "deleted": true,                                                                                                                                                                                            
    "ignored": false,                                                                                                                                                                                           
    "invalid": true,                                                                                                                                                                                            
    "localFlags": 8,                                                                                                                                                                                            
    "modified": "2020-03-19T08:32:08+01:00",                                                                                                                                                                    
    "modifiedBy": "7PHNUKS",                                                                                                                                                                                    
    "mustRescan": false,                                                                                                                                                                                        
    "name": "Helium/me.bluemail.mail/me.bluemail.mail.sync-conflict-20200318-115750-BTX3SK4.ab",                                                                                                                
    "noPermissions": false,                                                                                                                                                                                     
    "numBlocks": 0,                                                                                                                                                                                             
    "permissions": "0777",                                                                                                                                                                                      
    "sequence": 892,                                                                                                                                                                                            
    "size": 0,                                                                                                                                                                                                  
    "type": "FILE",                                                                                                                                                                                             
    "version": []                                                                                                                                                                                               
  },                                                                                                                                                                                                            
  "local": {                                                                                                                                                                                                    
    "deleted": true,                                                                                                                                                                                            
    "ignored": false,                                                                                                                                                                                           
    "invalid": true,                                                                                                                                                                                            
    "localFlags": 8,                                                                                                                                                                                            
    "modified": "2020-03-19T08:32:08+01:00",                                                                                                                                                                    
    "modifiedBy": "7PHNUKS",                                                                                                                                                                                    
    "mustRescan": false,                                                                                                                                                                                        
    "name": "Helium/me.bluemail.mail/me.bluemail.mail.sync-conflict-20200318-115750-BTX3SK4.ab",                                                                                                                
    "noPermissions": false,                                                                                                                                                                                     
    "numBlocks": 0,                                                                                                                                                                                             
    "permissions": "0777",                                                                                                                                                                                      
    "sequence": 892,                                                                                                                                                                                            
    "size": 0,                                                                                                                                                                                                  
    "type": "FILE",                                                                                                                                                                                             
    "version": []                                                                                                                                                                                               
  }                                                                                                                                                                                                             
}                                                                                                                                                                                                               

>curl -H "X-API-Key: XXXXXXXX" "http://192.168.28.2:8384/rest/db/file?folder=abcde-fghij&file=DOS/CARPET2/CARPET2.BAT"
{
  "availability": null,
  "global": {
    "deleted": false,
    "ignored": false,
    "invalid": true,
    "localFlags": 8,
    "modified": "1995-12-19T16:42:26+01:00",
    "modifiedBy": "7PHNUKS",
    "mustRescan": false,
    "name": "DOS/CARPET2/CARPET2.BAT",
    "noPermissions": false,
    "numBlocks": 1,
    "permissions": "0777",
    "sequence": 5876,
    "size": 61,
    "type": "FILE",
    "version": [
      "7PHNUKS:1"
    ]
  },
  "local": {
    "deleted": false,
    "ignored": false,
    "invalid": true,
    "localFlags": 8,
    "modified": "1995-12-19T16:42:26+01:00",
    "modifiedBy": "7PHNUKS",
    "mustRescan": false,
    "name": "DOS/CARPET2/CARPET2.BAT",
    "noPermissions": false,
    "numBlocks": 1,
    "permissions": "0777",
    "sequence": 5876,
    "size": 61,
    "type": "FILE",
    "version": [
      "7PHNUKS:1"
    ]
  }
}

The "invalid": true properties look suspiciously.

Do you mean the situation when the folder is send-receive? In that case I could change back to receive-only, would it help? If not and what you describe is an expected behaviour, what is wrong with my setup?

Thanks!

That’s fine: It’s due to the files being locally changed.

The first one is improvable: That’s a file that’s been deleted and doesn’t exist anywhere else - that could just be not shown. I will look into that. See https://github.com/syncthing/syncthing/issues/6432 and https://github.com/syncthing/syncthing/pull/6433

The second one says it is not deleted. So either it really exists, or the deletion is not picked up during scanning - for which I didn’t have any idea what to look at at the moment.

The second one says it is not deleted. So either it really exists,…

It really exists, at NAS. :slight_smile:

If you need some more information, please let me know.

Then it is indeed a locally changed (well added, but …) item - what’s the problem?

Then it is indeed a locally changed (well added, but …) item

The file, almost surely, was originally synced from the tablet, not added manually. But - if you remember - I also reset the index, hence if there were more files at NAS side than on the phone side, it could cause all the troubles. (But note that the folders were Up-to-date before I reset the index.)

Edit – the text was deleted –

Yes I do remember and that’s exactly why. As Audrius pointed out, resetting the index without knowing exactly why, how and when usually does cause trouble. After all you are erazing all history/state. I.e. it didn’t know anymore that these files once came from somewhere else, it just saw them on disk

So, what’s the current status?

  • You identified the problem that was causing Out-of-sync folders (IssueB). When it gets fixed and after the installation package for Synology NAS is created, will the problematic items disappear, or will I have to get rid of them manually, still?
  • Do you need anything else concerning the folders in the Local Additions state (IssueC), or can I fix their state using the red Revert Local Changes button, as suggested @Andy?
  • You identified the cause of the incorrect total size of out-of-sync items (IssueA). Will the fix resolve the same problem for locally-changed-items as well, or is this a separate problem?

Should I create a defect for the red button behaviour (you have to press it twice in order it works), or its current behaviour is correct? I would say it is not.

Edit: Now I realize that pressing the red button is not the right way to go. As some of the out-of-sync files exist on the NAS site, they would be probably deleted from NAS. Which is probably not what I want.

Issues A-C are fixed (well pending to be reviewed and merged into the main branch). They will be in 1.14.2 (or 1.15.0). Refer to your own issue or the following for status updates:

You will have to do nothing for those after upgrading. Until then the issues are just visual, the sync is still working as usual.

You will delete those files on the NAS if you do that. Let me repeat: @Andy’s enthusiasm for Syncthing is appreciated, however do not follow his advice unless you understand yourself exactly what he is advising or the advise has been confirmed by someone involved in the project (you can e.g. check the “label” after the username, like “Syncthing Maintainer”).

Edit: Case in point:

1 Like

Thinking about that again: As all my folders in the Local Additions state are set as unidirectional mirrors, if anything gets deleted from NAS side because it is not on the phone side, it is actually correct. Hence the red button should work in this case.

That’s fine. Everyone wants to help, but in everything we do, we need to be careful with it.

1 Like

Ignore deletes isn’t a thing anymore for you?

I use two scenarios:

  • Unidirectional mirrors, where deletes are allowed (and which resulted in the Local Additions). I use it for mirroring content of various directories from phone to NAS.
  • Unidirectional backups, where deletes are prohibited. I use this scenario mainly for backuping photos. Now I changed the type of the backup to bidirectional (which resulted in Out-of-sync), though it doesn’t work currently because of the privilege problems in Android.

Of course, in both cases I have then versioned backup set up at NAS in order to backup the synced folders.

1 Like

Then the revert changes button is indeed the right thing to do in the first case.

So, do you need anything else from me, or can I press the red button for all problematic folders?

?

In every case, I would like to thank you for your help, you were very very helpful. :slight_smile:

2 Likes

I ignored the pressing twice thingy for now, because it sounded like magic xD

So if you can still reproduce that, please take screenshots initially, after pressing once and then pressing twice and don’t yet go ahead with doing it on all the folders in case we need to debug it further. For all the other issues I don’t need anything more from you, thanks for your patience!