Massive unwanted deletion - Nextcloud client Windows

Yesterday I saw many notifications of photo synchronization errors from a folder, belonging to a superior one with many subfolders with more images. Let’s say that, from A to Z, the errors started with some photos corresponding to one of the folders that start with the letter R.

The “folder sync connection” was added as a “Photos” folder targeting “Photos” in the server files, and had synced successfully days ago with the “enable virtual file support” option on. Because of this option, every time I entered a folder with an image viewer, all the photos from that folder level were downloaded for the creation of thumbnails. It was somewhat annoying because a large notification from the Nextcloud client always appeared on the Windows notification area.

The failures in the folder that started with the letter R were constant. The notifications that cause Nextcloud client errors are annoying and the truth is that it fails very frequently, without giving much information on what causes it or how to fix it. The Nextcloud client for Windows many times fails to sync Files which can be handled smoothly with the Windows file manager or an application like TeraCopy, and for each of them it shows an error notification and changes the tray icon to the red X. “Failed to sync due to an error” is all each notification said. The indicated files were seen correctly from the web.

I thought that the problem would end if I chose the option “Make always available locally” in “Availability”. Apparently it began to download all the content, but in that folder that begins with R something terrible happened, and for some reason that I don’t understand it deleted all the content, its files and those of their corresponding subfolders. But in addition, it randomly deleted in the same way many files from other folders following those that start with R and some other letters that follow.

In the end, hours after I was able to verify, an unsolicited deletion of more than 400 images was carried out. The folders were left with their correct names but without their content.

The Nextcloud client dropdown showed red Xs on every deleted file, a lot of them. It was terrifying to watch. But in “Activity” from the web those operations do not appear. You only see the ones that I consciously made with files days ago.

From the web interface those folders do not show the content either. And “deleted files” only list things that I manually deleted days ago.

All this, synced from a HDD, so I tried using a data recovery software, to see if the deleted files could be brought back, but no luck. The files are listed as deleted but nothing recovered is consistent data. The actual contents should have been uploaded and deleted weeks ago, and this time the glitch did not allow them to be downloaded, and for some reason, they were deleted from the server.

Result: files deleted beyond recovery, on the system that was my backup, and which I didn’t think needed ANOTHER backup.

Nextcloud 26.0.1 installed on top of Ubuntu 22 LTS, with powerful dedicated hardware and 64GB of RAM. I have created other users for other PCs, and so far nothing like this has happened on my other computers, but there are frequently errors with files that cannot be uploaded and that are giving error notifications all the time.

This is one of the entries corresponding to one of the hundreds of files that were deleted, in the system log in AppData/Roaming/Nextcloud, although I don’t know if it is the correct part to see:

2023-05-08 10:00:03:716 [ info nextcloud.sync.discovery C:\Users\sysadmin\AppData\Local\Temp\2\windows-14889\client-building\desktop\src\libsync\discovery.cpp:423 ]:	Processing "Rome 2019/12356837_539470466207987_4650567794222567324_o.jpg" | (db/local/remote) | valid: true/true/db | mtime: 1449580729/1449580729/0 | size: 451664/451664/0 | etag: "f0794bc976ed73f179f8c8a15c72fb57"//"" | checksum: ""//"" | perm: "WDNVR"//"" | fileid: "00011173oc6w3y4dil5i"//"" | inode: 103035/103035/ | type: CSyncEnums::ItemTypeVirtualFile/CSyncEnums::ItemTypeVirtualFileDownload/CSyncEnums::ItemTypeFile | e2ee: false/false | e2eeMangledName: ""/"" | file lock: not locked//

Thanx in advance for any info.

Sync solutions are no backup. They just propagate deletion of files through all clients which makes it even worse.

If you have access to the log files, you can check when and who deleted the file:

grep DELETE access.log - user [11/May/2023:09:26:32 +0200] "DELETE /remote.php/dav/files/user/test_delete%20-%20Copy.csv HTTP/1.1" 204 0 "-" "Mozilla/5.0 (Windows) mirall/3.8.1stable-Win64 (build 20230419) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)" "-"

You have the date, the user name, the client string etc. Then you can go back to the desktop client and check the logs there why the file was deleted (with some change you have a few logs from the past even without enabling it: Appendix C: Troubleshooting — Nextcloud Client Manual 3.8.1 documentation)

Not sure if that helps. Some programs might instead of moving the files, first copy it to the new location and then delete it from the old one. Or if you copy a file outside the sync folder, it will be deleted from the sync folder!

1 Like