client icon indicating copy to clipboard operation
client copied to clipboard

Virtual File Sync no longer working properly

Open efrenbg1 opened this issue 5 years ago • 37 comments

Since the beginning of this week all clients updated automatically to client version 2.7.2. This made Virtual File Sync to stop working properly. I have observed two behaviors:

  1. With previous files synced -> New files are immediately deleted by clients with Virtual File Sync.
  2. On a clean sync -> Folders are perfectly created, but files are not, causing the client to delete every single file on the server.

Expected behaviour

Working with Virtual File Sync as expected.

Actual behaviour

All files are missing from the client folder, causing a complete wipe of data on the server.

Steps to reproduce

  1. Share folder with user x
  2. Add Virtual File Sync with user x
  3. Wait for second sync caused by missing files

Server configuration

Operating system: debian 10 (Linux 4.19.0 - amd64)

Web server: nginx/1.14.2

Database: 10.3.25-MariaDB

PHP version: 7.2.34

ownCloud version: 10.5.0

Storage backend (external storage): none

Client configuration

Client version: 2.7.2

Operating system: Windows 10 Pro 20H2

OS language: Spanish

Qt version used by client package (Linux only, see also Settings dialog): none

Client package (From ownCloud or distro) (Linux only): none

Installation path of client: C:\Program Files (x86)\ownCloud

Logs

  1. Client logfile: (Nothing on the log file)

  2. Web server error log: (Nothing on the log file)

  3. Server logfile: (Nothing on the log file)

What I've tried

  1. Full clean install of the client removing all %appdata% files

  2. Dowgrading to previous client versions (only 2.5.4 seems to work as of right now)

  3. Clean install of ownCloud server

  4. Update Windows 10 to latest version

~ Thanks in advanced for your hard work ~

efrenbg1 avatar Dec 10 '20 22:12 efrenbg1

I can confirm the behavior of file deletions on the server if the virtual file sync is used. Please provide an update.

voerg avatar Dec 11 '20 09:12 voerg

I have done more testing. The problem seems to be related to a Windows 10 update.

  1. All clients (including version 2.7.2) work perfectly under compilation version: 19042.662
  2. Not working under compilation version: 19042.685

Both Windows are on the 20H2 version. As a result of Windows update policy, all computers at my office updated at the beginning of this week causing also the update of the client (due to the reboot of the OS).

efrenbg1 avatar Dec 11 '20 10:12 efrenbg1

I have done more testing. The problem seems to be related to a Windows 10 update.

1. All clients (including version 2.7.2) work perfectly under compilation version:
   19042.662

2. Not working under compilation version:
   19042.685

Both Windows are on the 20H2 version. As a result of Windows update policy, all computers at my office updated at the beginning of this week causing also the update of the client (due to the reboot of the OS).

I can confirm that, we are trying to find what changed in the "cloud files" windows API. But if there was a major change in how windows 10 handle files, they would have announced it... I wonder if that's just a parameter/function name that changed between versions

Tenivar avatar Dec 11 '20 10:12 Tenivar

Thanks! We have identified the issue and are working on a fix. Indeed the Windows 10 API changed and the error was not handled correctly resulting in the above described issue. 2.7.3 client is upcoming ...

hodyroff avatar Dec 11 '20 13:12 hodyroff

Fixed in 2.7.3 https://github.com/owncloud/client/releases/tag/v2.7.3

TheOneRing avatar Dec 11 '20 17:12 TheOneRing

Is there a script to restore all files since a given date? Should be doable using bash & curl...

An moving files on the server CLI and then running occ file:scan would assign new file ids to the deleted files and all shares and metadata would be lost...

butonic avatar Dec 12 '20 12:12 butonic

@hodyroff Sorry for comment on a closed issue.

Can you share which API is changed in Windows 2020H2? It might affect other software use the same API.

Thanks.

welkineins avatar Dec 15 '20 01:12 welkineins

@hodyroff Sorry for comment on a closed issue.

Can you share which API is changed in Windows 2020H2? It might affect other software use the same API.

Thanks.

https://github.com/microsoft/Windows-classic-samples/issues/164

TheOneRing avatar Dec 15 '20 16:12 TheOneRing

@efrenbg1 @welkineins @voerg @Tenivar @butonic

Restore script is here https://github.com/JanAckermann/owncloud-restore-trash

AlexAndBear avatar Dec 16 '20 17:12 AlexAndBear

I'm a bit scared now to use ownCloud in production at my company, where I am responsible for the infrastructure. Could that happen again?

sapientorius avatar Dec 17 '20 09:12 sapientorius

Well. You might want to refer to https://github.com/microsoft/Windows-classic-samples/issues/164 to understand how that could happen at all and what levels are involved.

As much as I can't assure you that nifty things will never happy again, I can assure you that we do everything for our part to avoid that. This has been the most severe bug in the desktop syncing since years. I am grateful that we have mechanisms in place to help (trashbin).

dragotin avatar Dec 17 '20 10:12 dragotin

Well. You might want to refer to microsoft/Windows-classic-samples#164 to understand how that could happen at all and what levels are involved.

@dragotin Just out of curiosity. Don’t changes to the cloud file API show first in the Insiders program?

All changes made to the cloud file API (or others) are first tested and published to the Insiders channel, but considering they are making constant changes to that API I'm not really surprised that has passed under the radar.

efrenbg1 avatar Dec 17 '20 15:12 efrenbg1

Well. You might want to refer to microsoft/Windows-classic-samples#164 to understand how that could happen at all and what levels are involved.

@dragotin Just out of curiosity. Don’t changes to the cloud file API show first in the Insiders program?

All changes made to the cloud file API (or others) are first tested and published to the Insiders channel, but considering they are making constant changes to that API I'm not really surprised that has passed under the radar.

I'm running the beta insiders preview and the problematic change 19041.685 was released at the same time as for the other Windows users.

TheOneRing avatar Dec 17 '20 16:12 TheOneRing

@efrenbg1 @welkineins @voerg @Tenivar @butonic

Could you please download this zip file, unpack in a folder, read the read.me file

Please try to restore the files and provide feedback. (comment also shared in issue #38208.)

Thanks, i did try and run the restore.php,

Having a warning on composer install, and an error on php restore.php execution. Tryied both from the owncloud directory and from /home, with admin and user rights. won't work. Got an idea ? Am i doing something wrong ? is it related to the https ?

Warning on installation : Cannot create cache directory /home/desktop/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/desktop/.composer/cache/files/, or directory is not writable. Proceeding without cache Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Package operations: 2 installs, 0 updates, 0 removals

Installing sabre/uri (2.2.1): Downloading (100%) Installing sabre/xml (2.2.3): Downloading (100%) Generating autoload files Error on execution :

php restore.php Collection files to restore PHP Fatal error: Uncaught Sabre\Xml\ParseException: The input element to parse is empty. Do not attempt to parse in /home/desktop/restore/vendor/sabre/xml/lib/Service.php:122 Stack trace: #0 /home/desktop/restore/lib/RestoreTrash.php(59): Sabre\Xml\Service->parse(false) #1 /home/desktop/restore/lib/RestoreTrash.php(25): RestoreTrash->collectTrashbinData() #2 /home/desktop/restore/restore.php(11): RestoreTrash->run() #3 {main} thrown in /home/desktop/restore/vendor/sabre/xml/lib/Service.php on line 122

EdouardRt avatar Dec 18 '20 10:12 EdouardRt

@EdouardRt some permission errors, please try to follow the steps here: https://askubuntu.com/questions/1077879/cannot-create-cache-directory-home-user-composer-cache-repo-https-packagi

AlexAndBear avatar Dec 18 '20 10:12 AlexAndBear

thank you for your help @JanAckermann ! it does go through the cache warning, but the error while restoring remains :

sudo -u www-data php restore.php
Collection files to restore
PHP Fatal error:  Uncaught Sabre\Xml\ParseException: The input element to parse is empty. Do not attempt to parse in /home/desktop/restore/vendor/sabre/xml/lib/Service.php:122
Stack trace:
#0 /home/desktop/restore/lib/RestoreTrash.php(59): Sabre\Xml\Service->parse(false)
#1 /home/desktop/restore/lib/RestoreTrash.php(25): RestoreTrash->collectTrashbinData()
#2 /home/desktop/restore/restore.php(10): RestoreTrash->run()
#3 {main}
  thrown in /home/desktop/restore/vendor/sabre/xml/lib/Service.php on line 122

My detailed configuration is available here. Meanwhile, i wander if the naming of elements in my trashbin is "normal" ie. IMG_0550.JPG.d1607618465 ?

EdouardRt avatar Dec 18 '20 11:12 EdouardRt

@EdouardRt Did you changed the variables in the restore.php as written in documentation? https://github.com/JanAckermann/owncloud-restore-trash

This error usually occures if the script can't connect to the server

Meanwhile, i wander if the naming of elements in my trashbin is "normal" ie. IMG_0550.JPG.d1607618465 ?

Totaly "normal", please don't try to rename them

AlexAndBear avatar Dec 18 '20 11:12 AlexAndBear

@JanAckermann Yes, variables are defined, all 4 between single quotes : 'name' ; 'https://website.xt' ; 'p@sword' ; 'yyyy-mm-dd' . I know i have a problem with the https certificate which needs browsing through chrome to hit the "proceed anyway" button. the windows client connects though, but maybe a php command could be weaker ?

EdouardRt avatar Dec 18 '20 11:12 EdouardRt

@EdouardRt please try the following:

  1. Get the new version of the restore script here
  2. In restore.php set ignore SSL to true (without quotes)
  3. Run the script again

AlexAndBear avatar Dec 18 '20 12:12 AlexAndBear

Thanks for the updated script ! Feeling sorry @JanAckermann : getting an error (404 !?) :-( and can't find any log that would help /var/log/syslog or /php7.0-fpm.log or /apache2/log ...

sudo -u www-data php restore.php
Collection files to restore
ERROR: The requested URL returned error: 404 Not FoundPHP Fatal error:  Uncaught Sabre\Xml\ParseException: The input element to parse is empty. Do not attempt to parse in /home/desktop/restore/owncloud-restore-trash-master/vendor/sabre/xml/lib/Service.php:122
Stack trace:
#0 /home/desktop/restore/owncloud-restore-trash-master/lib/RestoreTrash.php(74): Sabre\Xml\Service->parse(false)
#1 /home/desktop/restore/owncloud-restore-trash-master/lib/RestoreTrash.php(27): RestoreTrash->collectTrashbinData()
#2 /home/desktop/restore/owncloud-restore-trash-master/restore.php(11): RestoreTrash->run()
#3 {main}
  thrown in /home/desktop/restore/owncloud-restore-trash-master/vendor/sabre/xml/lib/Service.php on line 122

EdouardRt avatar Dec 18 '20 13:12 EdouardRt