client icon indicating copy to clipboard operation
client copied to clipboard

Sync error loop on Windows 10, after reinstalling app crashed during sync and starts to delete files after automatic restart

Open netzimon opened this issue 5 years ago • 33 comments

Expected behaviour

File sync using virtual files on Windows 10 after automatic app upgrade.

Actual behaviour

A group of regular PDF files are ignored in the sync process due to an unknown reason and displayed in the ignore window of the desktop client. Client keeps trying to resync the same group of files though produces the same error, hence get caught in a loop and never completes the sync for which other files pending syncing are put on hold and never uploaded/downloaded. After reinstalling the app, on some computers the app crashes and automatically restarts or is manually restarted. After restart the app starts to remove all files from the server that have not yet been downloaded, rather than picking up the sync where it left off and downloading those files.

Steps to reproduce

  1. Automatic upgrade to latest version of Windows 10 OwnCloud client without changing or reinstalling sync account.
  2. Wait for sync loop error.
  3. Reinstall app by downloading latest version from Owncloud.com.
  4. Reconfigure sync account and link an empty folder where the files should download.
  5. Files start to download, then wait for crash.
  6. After automatic or manual app restart, files are being removed from server rather than being downloaded.

Server configuration

Operating system: CentOS 7.8 Web server: Apache/2.4.6 (CentOS) Database: mysql Ver 15.1 Distrib 5.5.65-MariaDB PHP version: PHP 7.2.33 ownCloud version: ownCloud 10.5.0 Storage backend (external storage): No external storage

Client configuration

Client version: 2.7.3.2877 and 2.7.2.2626 Operating system: Windows 10 Home 2004 19041.685 OS language: Spanish Installation path of client: C:\Program Files (x86)\ownCloud\

Logs

No error log file was configured on either of the 12 machines with the same issue. In order to avoid getting more files deleted (we already have to manually restore over 230,000 files from different user trash bins) we can't run the app again to reproduce the error as it sometimes takes several hours for the app to crash and then in a few minutes starts to remove thousands of files. We do have the server log file, activity output in client window as well as the .owncloudsync.log file in the OwnCloud file folder window in 2 of the machines.

netzimon avatar Dec 13 '20 17:12 netzimon

Please send .owncloudsync.log to apps-<at>-owncloud.com

michaelstingl avatar Dec 13 '20 19:12 michaelstingl

Thank you. Log file and more information sent

netzimon avatar Dec 14 '20 01:12 netzimon

Update

We did more tests using an account with an limited amount of files that could easily be restored. The desktop app does not seem to crash/restart, but rather to freeze/stall a bit, then goes into Looking for changes in folder and right after that the elimination process starts. The reasons seems to be that the virtual file links are never created and this is probably the reason why the desktop app thinks it should remove those files from the server (since the local folders are empty). When switching off the virtual files mode the actual files are created without any problem. We tested this on the C:/ drive as well as on a secondary partition of the same hard drive - same result. We enabled the comprehensive log on the desktop app. This segment with errors repeats throughout the log file:

12-13 21:55:22:756 [ info sync.propagator ]: Completed propagation of "clientest/Word Test/TEST TEST TEST TEST - Copy.docx" by OCC::PropagateDownloadFile(0x24cf1338) with status OCC::SyncFileItem::Success 12-13 21:55:22:756 [ debug sync.statustracker ] [ OCC::SyncFileStatusTracker::slotItemCompleted ]: Item completed "clientest/Word Test/TEST TEST TEST TEST - Copy.docx" OCC::SyncFileItem::Success CSyncEnums::CSYNC_INSTRUCTION_NEW 12-13 21:55:22:763 [ info sync.propagator ]: Starting INSTRUCTION_NEW propagation of "clientest/Word Test/TEST TEST TEST TEST.docx" by OCC::PropagateDownloadFile(0x24cf12b8) 12-13 21:55:22:763 [ debug sync.propagator.download ] [ OCC::PropagateDownloadFile::start ]: "clientest/Word Test/TEST TEST TEST TEST.docx" 0 12-13 21:55:22:763 [ debug sync.propagator.download ] [ OCC::PropagateDownloadFile::start ]: creating virtual file "clientest/Word Test/TEST TEST TEST TEST.docx" 12-13 21:55:22:763 [ warning sync.vfs ]: CfCreatePlaceholders error "La operación de nube no es válida." "La operación se completó correctamente." "clientest\Word Test\TEST TEST TEST TEST.docx" 12-13 21:55:22:763 [ warning sync.vfs ]: convertToPlaceholder: could not get handle for "C:/octest/clientest/Word Test/TEST TEST TEST TEST.docx" 12-13 21:55:22:763 [ critical sync.csync.vio_local ]: CreateFileW failed on \?\C:\octest\clientest\Word Test\TEST TEST TEST TEST.docx 12-13 21:55:22:763 [ warning sync.fileitem ]: Failed to query the 'inode' for file "C:/octest/clientest/Word Test/TEST TEST TEST TEST.docx"

The complete log file has been sent via email.

netzimon avatar Dec 14 '20 04:12 netzimon

Looks like this is the issue: https://central.owncloud.org/t/virtual-file-sync-no-longer-working-properly/29388/8

We will be doing more tests tomorrow to confirm.

netzimon avatar Dec 14 '20 05:12 netzimon

Update

We did more tests using an account with an limited amount of files that could easily be restored. The desktop app does not seem to crash/restart, but rather to freeze/stall a bit, then goes into Looking for changes in folder and right after that the elimination process starts. The reasons seems to be that the virtual file links are never created and this is probably the reason why the desktop app thinks it should remove those files from the server (since the local folders are empty). When switching off the virtual files mode the actual files are created without any problem. We tested this on the C:/ drive as well as on a secondary partition of the same hard drive - same result. We enabled the comprehensive log on the desktop app. This segment with errors repeats throughout the log file:

12-13 21:55:22:756 [ info sync.propagator ]: Completed propagation of "clientest/Word Test/TEST TEST TEST TEST - Copy.docx" by OCC::PropagateDownloadFile(0x24cf1338) with status OCC::SyncFileItem::Success 12-13 21:55:22:756 [ debug sync.statustracker ] [ OCC::SyncFileStatusTracker::slotItemCompleted ]: Item completed "clientest/Word Test/TEST TEST TEST TEST - Copy.docx" OCC::SyncFileItem::Success CSyncEnums::CSYNC_INSTRUCTION_NEW 12-13 21:55:22:763 [ info sync.propagator ]: Starting INSTRUCTION_NEW propagation of "clientest/Word Test/TEST TEST TEST TEST.docx" by OCC::PropagateDownloadFile(0x24cf12b8) 12-13 21:55:22:763 [ debug sync.propagator.download ] [ OCC::PropagateDownloadFile::start ]: "clientest/Word Test/TEST TEST TEST TEST.docx" 0 12-13 21:55:22:763 [ debug sync.propagator.download ] [ OCC::PropagateDownloadFile::start ]: creating virtual file "clientest/Word Test/TEST TEST TEST TEST.docx" 12-13 21:55:22:763 [ warning sync.vfs ]: CfCreatePlaceholders error "La operación de nube no es válida." "La operación se completó correctamente." "clientest\Word Test\TEST TEST TEST TEST.docx" 12-13 21:55:22:763 [ warning sync.vfs ]: convertToPlaceholder: could not get handle for "C:/octest/clientest/Word Test/TEST TEST TEST TEST.docx" 12-13 21:55:22:763 [ critical sync.csync.vio_local ]: CreateFileW failed on ?\C:\octest\clientest\Word Test\TEST TEST TEST TEST.docx 12-13 21:55:22:763 [ warning sync.fileitem ]: Failed to query the 'inode' for file "C:/octest/clientest/Word Test/TEST TEST TEST TEST.docx"

The complete log file has been sent via email.

The error message you post is a 2.6.3 log, which is also affected by https://owncloud.com/news/important-windows-client-issue-fix-available/ please upgrade to 2.7.3.

TheOneRing avatar Dec 14 '20 09:12 TheOneRing

Important Recovery Request

We are trying to recover some 380,000 files that were deleted in bulk due to the Windows desktop client issue, which is an impossible task to do through the Web interface. We are already experiencing a tremendous amount of work caused by this issue.

On some users whose desktop client caused a lot of deleted files I can't even access the removed files through the Web interface. The following error message being returned: The directory is unavailable, please check the logs or contact the administrator. I have, however, checked the trash bin folder on the server for these users - the folder and all deleted files are there. All the files also show up on the oc_files_trash table.

  1. Is there a command I can run using CLI to automatically restore all files that were deleted by a specific user?
  2. If not, please provide me with the actual PHP code that would execute the recovery sequence as if it were to be executed through the Web interface. I would create a loop around your code to go through the oc_files_trash table and restore files based on the auto_id or the user column.

netzimon avatar Dec 16 '20 02:12 netzimon

Happend to me exactly as described by @netzimon after at least one Windows client was automatically updated to 2.7.3 and for two entirely separate networks with their own ownCloud instances. Would really appreciate a command or code piece to bulk restore files as this seems to be an impossible task right now.

ITGremm avatar Dec 16 '20 15:12 ITGremm

Restoring from Webfront is an impossible task. We have round about 25k files. While restoring, the mysql database is eating up my CPU (Xeon CPU E5-2620 v4). The VM has already all 8 Cores.

Please provide a solution, like occ restore command or something more powerful

mat-ti avatar Dec 16 '20 15:12 mat-ti

Our support and server team is working on a solution.

TheOneRing avatar Dec 16 '20 16:12 TheOneRing

Our support and server team is working on a solution.

Thank you. Do you have an ETA?

Also, may I suggest to provide a stand alone code snippet or CLI script that could be easily uploaded and executed directly on the server? Given the emergency situation most of us are in due to this situation, having to upgrade the OwnCloud core itself to a new version would not be feasible right now.

netzimon avatar Dec 16 '20 16:12 netzimon

Related issue in the owncloud/core repo: https://github.com/owncloud/core/issues/38208

michaelstingl avatar Dec 16 '20 17:12 michaelstingl

We provided a first idea for mass restore here: https://github.com/owncloud/client/issues/8295#issuecomment-746734689

hodyroff avatar Dec 16 '20 20:12 hodyroff

So is this an issue related to the client?

I also am experiencing this issue - Working through the web client is fine but anyone who syncs their files via the client software - All files shared to to them are deleted upon sync.

perpetuaIwar avatar Dec 16 '20 20:12 perpetuaIwar

So is this an issue related to the client?

I also am experiencing this issue - Working through the web client is fine but anyone who syncs their files via the client software - All files shared to to them are deleted upon sync.

That is correct. It affects the Windows desktop app if running under the latest version of Windows 10. All OwnCloud versions prior to 2.7.3 are affected. You need to upgrade to 2.7.3 and then restore the deleted files using the Web interface or the mass restore client mentioned earlier today.

netzimon avatar Dec 16 '20 20:12 netzimon

So is this an issue related to the client? I also am experiencing this issue - Working through the web client is fine but anyone who syncs their files via the client software - All files shared to to them are deleted upon sync.

That is correct. It affects the Windows desktop app if running under the latest version of Windows 10. All OwnCloud versions prior to 2.7.3 are affected. You need to upgrade to 2.7.3 and then restore the deleted files using the Web interface or the mass restore client mentioned earlier today.

Thanks for the information, netzimon. I will wait patiently for an update from the Owncloud team. Hopefully there will be an update soon. My company is not too happy at the moment.

perpetuaIwar avatar Dec 16 '20 20:12 perpetuaIwar

Actually, I'm a bit confused - 5 hours ago, it was mentioned by someone they were working on a resolution. So the fix is to just upgrade to 2.7.3 then restore the files or is this still being worked on by Owncloud?

perpetuaIwar avatar Dec 16 '20 21:12 perpetuaIwar

Actually, I'm a bit confused - 5 hours ago, it was mentioned by someone they were working on a resolution. So the fix is to just upgrade to 2.7.3 then restore the files or is this still being worked on by Owncloud?

Yes, the fix is to upgrade to 2.7.3 and then restore the files. They were working on a mass restore script which now has been released.

netzimon avatar Dec 16 '20 21:12 netzimon

Noted. Thank you!

perpetuaIwar avatar Dec 16 '20 21:12 perpetuaIwar

The issue with the mass delete was fixed on Friday. https://owncloud.com/news/important-windows-client-issue-fix-available/ If the issue was discovered during a sync an the sync was aborted, the client then updated, the new client might continue to move files to the trash. So in case the sync was aborted the sync_*.db needs to be removed.

As mentioned in https://github.com/owncloud/client/issues/8300#issuecomment-746957855 we have a script that helps restoring the files https://github.com/owncloud/client/issues/8295#issuecomment-746734689 . This is not the final scrip and we will come up with a simpler solution.

TheOneRing avatar Dec 16 '20 21:12 TheOneRing

As @TheOneRing mentioned, please update the client and use the script mentioned for restore the deleted data: https://github.com/owncloud/client/issues/8300#issuecomment-746957855.

Tommorow i'll open a git project, instead just providing a ZIP file.

In fact the script does:

  1. Scanning the trashbin
  2. Selecting the removed data which was removed since this issue occured
  3. Restore each item.

Based on the amount of data this might take a while. Killing/Restarting the script does not harm your data and also keeps the state.

Git Repo is here: https://github.com/JanAckermann/owncloud-restore-trash

AlexAndBear avatar Dec 16 '20 22:12 AlexAndBear