Aperiodic Delete Issue on android device

The Aperiodic Delete always triggered by one of the android device(Android Device A, info given below) after a RemoteIndexUpdatedStateChanged(idle→sync-waiting→sync-preparing→…).

  • After RemoteIndexUpdated and StateChanged , Syncthing delete massive folder and files in the shared folder on all device.
  • Only happen in one folder (StarFloraHoshirie) when containing certain files, while other shared folder work well among same devices.
    • Seemed related with certain files(simply just .md and .png files), no matter what folder name or path is.
    • Only trigger by Android Device A, not Android Device B.

I collected three SyncTrayzor under Trace mode, corresponding(cover) to three times Aperiodic Delete Issue happened. Attached here:

SyncTrayzor240112.log (19.1 MB)

  • around line 606300, 2024-01-12 08:26:25.

SyncTrayzor240114.log (17.3 MB)

  • around line 545120, 2024-01-14 23:40:46

SyncTrayzor240116.log (2.5 MB)

  • aound line 39307, 2024-01-16 00:30:32

Previous relative topic posted here

Version Info:

For any following PCs menstioned:

  • SyncTrayzor: 1.1.29 & Syncthing: 1.27.2

For any following Android Devices menstioned:

  • Syncthing: 1.27.2.1 (from google play)

GUI screenshot for related devices:

Android Device A:

Android Device B:

PC Device C:

图片

  • All these device have direct share between each other. (ie. mesh topology)
  • All Folders are set to send & Receive.

Advanced Folder Setting Info:

Folders’ Max Conflict are set to 0 to avoid obsdidian related workspace-mobile.json conflict. (this folder are used as obsidian vault in all device above.)

  • !: No other Synchronizing Software or Service(eg. Obsidian Sync etc.) had ever run on this folder.

Really need your help, thank you!

PS: Here’s my guess:

This can somehow explain why the issue seemed always triggered by the Android Phone device A.

  • Is this possible? And, any way to avoid this?

If that file is device specific, you should ignore it instead.

1 Like

We’ve observed in the past, that android, with its filesystem abstraction that is used presumably for sandboxing, can sometime lead to files disappearing and re-appearing a few seconds later. This gets observed by syncthing, which might be the cause of your issue.

We don’t know why that happens, we’re not really involved enough in Android to understand it, but I recall debugging some issues with a user a few years ago and effectively coming to the conclusion that this is what was happening.

It might be phone brand/rom brand specific, might be specific to data that is on sd cards, I am not exactly sure what is the set of constraints are where this can happen.

1 Like

Oh my, I think you are RIGHT.

I ecounter the same issue again around 20:16:55(cst). This time I search the name s of the missing folders in an explorer app (estrongs, or ES explorer).

  • I found they somehow still ‘exist’ in the original path. (ie. /storage/emulated/0/StarFloraHoshirie/Vanguard/) But the propertity(?) turned from drw to -rw as you can see in the picture. I think it’s Linux-property-like thing meaning the authority for current users and the existing form of files and folders.
    • Not sure whether these folders are actually gone/deleted when they turned to -rw. But most android explorer apps will not show them as folders any more, and cant even search them like estrongs.
    • Not sure whether they would be further wiped out completely that cant even be searched.
    • I think it’s basically the same as these folders being deleted.
  • I’ve confirmed that all the missing folders can be searched and found turned into the same form in estrongs. And I dont have the way to recover them.
    • What these deleted folders have in common is that they are either empty folders, or all their subfolders are empty. Though there could be some very small size files also included which I didnt noticed.
    • A bit comfort that the folders contain files seemed escaped this Deletion.
    • Not all the empty folder will be “delete” made me confused in the precious discussion.

update 240119-00:53: now is all.

  • it is a continous progress will keep deleteing the empty folders untill none of them exist.

About the reason

The android system (android 9, EMUI 9.1.0, Hwawei VOG-AL00), more specificly the Huawei custom-built android system has a built-in optimizer app.

Filke Member Feb 3, 2017 16 0 * May 25, 2021 * #10

Hello mates, same problem with my P30 and Optimizer app. It randomly erases some files that are recognized as junk but they aren’t junk and not just apk files. I read that solution to remove Optimizer with ADB isn’t the smartest idea. I disabled Optimizer settings to do “Auto-clean junk files”. Is is enough or I could do something else?

  • It just so happens Im intereated on the folder .RecycleBinHW since there is encrypted files in it and you cant find any app related to it. I want to know what indeed is it.
  • According to the forum discussion, there were once a morecritical bugs with it.
    • Now, the bug seems to delete most empty folders in folders which is frequently check/scan(?).
    • What I think a could do is to create a txt file(no need to write anything in txt file) in it. This DID prevented the ‘Optimizer’ erase the folders at the moment.

You can find the related topic on xdaforums in:

More about the log content…

Please allow me to ask to more question.

  • ① what is it mean when folders property modified to -rw
  • ② I found some [warn] records in the SyncTrayzor.logs like:
[Warn] SyncTrayzor.Syncthing.Folders.FolderStateTransformer: Unknown folder sync state sync-waiting. Defaulting to Idle 
[Warn] SyncTrayzor.Syncthing.Folders.FolderStateTransformer: Unknown folder sync state sync-preparing. Defaulting to Idle
  • Are they related to some abnormal(maybe?) behavior to StateChanged and RemoteIndexUpdate ?
    • And can we tell/diagnose this kind of android brand/rom brand specific problem(the deletion event) base on the log content?

Thank you for your patience!

  • Your answers help a lot.

The warning is meaningless, the synctrayzor wrapper just doesn’t handle the new events.

You can debug this only on the phone by enabling the scanner logging facility, which I suspect will report that files were deleted and then later appeared (this proves my theroy), however this won’t help you answer why this happens, as this doesn’t happen in syncthing, it happens in the OS.

Details on what the permission bits mean: Linux / Unix File Permissions Explained.

d is a type bit, suggesting the path is a directory, absence of that bit suggests it turned into a file (no idea what this means or why it happens, ask Huawei)

1 Like

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