syncthing: Scan on absolute path creates incorrect absolute duplicate file infos

Reproducer

Run scan through rest API on a “virtually” absolute path that has no changed children, e.g. in my case folder root at /home/simon/test-sync and

curl -X POST -H "X-API-KEY: myapikey" "localhost:8385/rest/db/scan?folder=3vbey-elvwr&sub=/foo"

Result:
State counter increases and scanner debug log shows the problem:

[BXAEQ] 2018/03/10 11:09:21.303458 walk.go:101: DEBUG: Walk [/foo] 131072 Matcher/[nonreach* **/nonreach* nonreach*/** **/nonreach*/**]@0xc4202522d0
[BXAEQ] 2018/03/10 11:09:21.303837 walk.go:316: DEBUG: to hash: /foo File{Name:"/foo", Sequence:0, Permissions:0664, ModTime:2017-12-27 23:10:28.912229075 +0100 CET, Version:{[{BXAEQNX 1}]}, Length:741, Deleted:false, Invalid:false, NoPermissions:true, Blocks:[]}
[BXAEQ] 2018/03/10 11:09:21.303876 walk.go:186: DEBUG: real to hash: /foo
[BXAEQ] 2018/03/10 11:09:21.304035 walk.go:164: DEBUG: Walk progress done 3vbey-elvwr [/foo] 131072 Matcher/[nonreach* **/nonreach* nonreach*/** **/nonreach*/**]@0xc4202522d0

Expected:
No change at all.

Proposed fix

According to this comment the absolute path is valid, so it shouldn’t throw an error, but scan normally removing the leading path separator.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Yes.

(@imsodin) The culprit (well sort of) is #4671: Before that unifySubs([]string{“/foo”}) returned nil, now /foo.

So I guess if Android had been doing this all the time, it was fine up until 0.14.44 at which point it became a problem. Now those devices have index entries that are not accepted in other places. So we might want Android users upgraded to 0.14.46-rc.1 when we release that, with the fix for this.

@llzzrrdd I can recommend using f-droid: https://f-droid.org/packages/com.nutomic.syncthingandroid/
Besides many other good reasons to use it, you can install old versions. There are also apks there if you really don’t want to use it.

Only on android devices yes, no idea how to do the rollback though. You need to remove the database also when rolling back.

Hi @calmh ! Is there a way to roll back to 0.14.44 since that was working? Plus does this roll back has to happen only in Android devices to resolve the issue? Thanks!!!