Owncloud client deleted all files (not folders) - cannot restore from trash
Dear Owncloud support,
Please consider the following issue, as the application seems to have sent from the client side the order of deleting every single file to the server - where i can not restore them. Being a major issue, i need your support in getting a set of commands to restore the files at their initial locations.
Thank you for your help,
Steps to reproduce
- Hit the "free local space" in the client owncloud configuration
Expected behaviour
Remove cash or duplicate entries ? ... but not delete all files from both client and server side. (160Go data)
Actual behaviour
-
Each and every file (not folders) is hiddely deleted locally and moved to trash
Log file show many rows as follows : {"reqId":"3fa0209f-fab4-4406-8c55-ae6c7fa761f0","level":3,"time":"2020-12-10T14:24:23+00:00","remoteAddr":" ","user":"user","app":"PHP","method":"PROPFIND","url":"/remote.php/dav/files/user/10.%20OffTracks/01.%20Photos/2008","message":"Use of undefined constant all - assumed 'all' at /var/www/owncloud/config/config.php#27"}
While trash content files are as such : (including the exteension avec .jpg) in owncloud_data/data/user/files_trashbin/files IMG_0548.JPG.d1607621089 IMG_0548.JPG.d1607627284 IMG_0549.JPG.d1607618449 IMG_0549.JPG.d1607618465 IMG_0549.JPG.d1607621090 IMG_0549.JPG.d1607627285 IMG_0550.JPG.d1607618449 IMG_0550.JPG.d1607618465 IMG_0550.JPG.d1607621091 IMG_0550.JPG.d1607627285 VID_20180511_110305059.mp4.d1607632103 VID_20180511_110348135.mp4.d1607632104 VID_20180511_110427392.mp4.d1607632106 VID_20180511_110611853.mp4.d1607632107 VID_20180511_110646442.mp4.d1607632107 VID_20180511_110745430.mp4.d1607632107 VID_20180511_110825575.mp4.d1607632107 VID_20180511_110953624.mp4.d1607632108 VID_20180511_111058566.mp4.d1607632109 VID_20180511_111521365.mp4.d1607632110 VID_20180511_162624793.mp4.d1607632110 (38000 lines to go)
-
The "deleted files" page is not accessible : "folder not available" error message showing I therefore can not restore files from there. Also, copying files from the owncloud_data/data/user/files_trashbin/files was not tried as the files have the weired extension.
Server configuration
Operating system: Ubuntu 18.04.5 LTS
Web server: Apache/2.4.29 (Ubuntu)
Database: 10.1.47-MariaDB-0ubuntu0.18.04.1
PHP version: PHP 7.2.27-6+ubuntu18.04.1+deb.sury.org+1
ownCloud version: (see ownCloud admin page) ownCloud 10.2.1 (stable)
Updated from an older ownCloud or fresh install: Updated
Where did you install ownCloud from: Standard rep.
Signing status (ownCloud 9.0 and above): ? sorry, don't get it. Login is successfull. Eventhough the log shows errors saying that "token does not exist" {"reqId":"4eb62482-1552-4f2f-8ed2-516c24110e6e","level":0,"time":"2020-12-10T14:24:23+00:00","remoteAddr":"78.227.207.70","user":"user","app":"OC\Authentication\Token\DefaultTokenProvider::getToken","method":"PROPFIND","url":"/remote.php/dav/files/user/10.%20OffTracks/01.%20Photos/2009","message":"token 388d2edcb61d7f054677ae606687d1547c872e8d72f3577d2d8eddde412abf461bcf0ff7ce5737c7a7814f297ee9bba20a446dbb2f33f476c72968a847b7f34c does not exist"} But browsing through the application is ok.
Login as admin user into your ownCloud and access
http://example.com/index.php/settings/integrity/failed
paste the results into https://gist.github.com/ and puth the link here.
No errors have been found.
The content of config/config.php: https://gist.github.com/EdouardRt/ede28e412f93f4e8c11abd2e432f8db0
List of activated apps: Enabled:
- activity: 2.6.0
- comments: 0.3.0
- configreport: 0.2.0
- dav: 0.4.0
- federatedfilesharing: 0.4.0
- federation: 0.1.0
- files: 1.5.2
- files_external: 0.7.1
- files_pdfviewer: 0.11.0
- files_sharing: 0.11.0
- files_texteditor: 2.3.0
- files_trashbin: 0.9.1
- files_versions: 1.3.0
- files_videoplayer: 0.10.1
- firstrunwizard: 1.2.0
- gallery: 16.1.1
- impersonate: 0.5.0
- market: 0.5.0
- notifications: 0.5.0
- provisioning_api: 0.5.0
- systemtags: 0.3.0
- templateeditor: 0.4.0
- updatenotification: 0.2.1 Disabled:
- encryption
- external
- user_external
Are you using external storage, if yes which one: local/smb/sftp/... No
Are you using encryption: no No
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... No
Client configuration
ownCloud 2.7.2 (build 2626) e52f9e Dec 2 2020 01:23:59 Libraries Qt 5.12.9, OpenSSL 1.1.1g 21 Apr 2020 Using virtual files plugin: wincfapi
Browser: Chrome
Operating system: Windows
Logs 0
Web server error log
Nothing relevant
ownCloud log (data/owncloud.log)
Extrat taken from the time the file deletion seams to have started https://gist.github.com/EdouardRt/ba2a452b8f6e3a32683c0f780ba63ebe
I changed the expire set in owncloud configuration to make sure the files are not permanently deleted. Please advice if anything else has to be performed meanwhile we work on the issue to make sure the files are not permanently removed.
Take care,
Ed.
Also check discussion in owncloud/client repo: https://github.com/owncloud/client/issues/8300
Thanks @michaelstingl, i did trying and run the restore.php available at #8295
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
Closing this issue which is successfully resolved after owncloud update, php upgrade, correction of rights on folders and the restore script. Please refer to this thread if you have similar issues. Thank you to the community for its help ! Edouard
Thanks Edouard for sharing this issue and the fix. Just a simple testimony if that can help other people : I've been through the same issue, on a Debian 9 system with PHP 7.0 . 10K files deleted by a windows client. I had to upgrade to Debian 10, then upgrade PHP to 7.3 then upgrade owncloud. Then I ran the script , which ran well on its side, but unfortunately on the server side, I had for each file to restore an error HTTP 405 METHOD NOT ALLOWED for the the "MOVE" operation : 10.100.1.1 - - [29/Jul/2021:07:38:33 -0400] "MOVE /owncloud//owncloud/remote.php/dav/trash-bin/myuser/16488 HTTP/1.1" 405 697 "-" "-"
at the end, the files didn't get restored. I don't know if this is because : a) I ran the script on the server itself ? b) I have this strange "/owncloud//owncloud" at the beginning of the URL
Anyway, I found on the new owncloud web interface a "select all" checkbox in the "Trash" page. I just clicked it and pressed Restore. The operation takes a while, but it finally works. Files restored, situation saved.
Thanks owncloud team, thanks Edouard.