Repository navigation
Description
Steps to reproduce
- Move files and directories from one folder to another folder
Expected behaviour
Files and directories should be moved to new directory and keep their integrity.
Actual behaviour
On the WebUI, directories and files got duplicated and directories are empty, despite the interface showing a file-size:

On the server, directories are not duplicated, but also empty:
total 84
drwxr-xr-x 2 www-data www-data 4096 Oct 24 2016 Authorisations
drwxr-xr-x 2 www-data www-data 4096 Oct 24 2016 Budget
drwxr-xr-x 2 www-data www-data 4096 Oct 24 2016 Concept
drwxr-xr-x 2 www-data www-data 4096 Oct 24 2016 Contract
drwxr-xr-x 2 www-data www-data 4096 Oct 24 2016 Décompte_final
drwxr-xr-x 2 www-data www-data 4096 Oct 24 2016 Devis
drwxr-xr-x 2 www-data www-data 4096 Oct 24 2016 Dossier_presse
drwxr-xr-x 2 www-data www-data 4096 Oct 24 2016 Evaluation
drwxr-xr-x 2 www-data www-data 4096 Oct 24 2016 Factures
drwxr-xr-x 2 www-data www-data 4096 Oct 24 2016 Funding
root@:data/path/to/above/folder# ls -l Authorisations/
total 0
Re-scanning the files did not help.
Server configuration
Operating system: Debian 8.8
Web server: Apache 2.4.10
Database: MySQL 5.5.55
PHP version: 5.6.30
ownCloud version: 9.1.6-1.1
Updated from an older ownCloud or fresh install: Update
Where did you install ownCloud from: Your debian repositories
Signing status (ownCloud 9.0 and above): No errors have been found.
The content of config/config.php:
{
"system": {
"appstoreurl": "https:\/\/marketplace.owncloud.com\/api\/v0",
"instanceid": "oc4idy8i5xh4",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"cloud.***REMOVED DOMAIN***"
],
"datadirectory": "\/var\/www\/"***REMOVED SENSITIVE VALUE***\/oc-storage",
"overwrite.cli.url": "http:\/\/***REMOVED DOMAIN***",
"dbtype": "mysql",
"version": "9.1.6.2",
"dbname": "owncloud",
"dbhost": "localhost",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"loglevel": "0",
"preview_libreoffice_path": "\/usr\/bin\/libreoffice",
"theme": "",
"maintenance": false,
"log_type": "owncloud",
"logfile": "\/var\/log\/owncloud.log",
"updatechecker": false,
"trashbin_retention_obligation": "60",
"mail_from_address": "cloud",
"mail_smtpmode": "smtp",
"mail_domain": "***REMOVED DOMAIN***",
"mail_smtphost": "smtp.gmail.com",
"mail_smtpport": "587",
"mail_smtpauth": 1,
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"mail_smtpsecure": "ssl",
"mail_smtpauthtype": "LOGIN"
}
}
List of activated apps:
Enabled:
- activity: 2.3.2
- comments: 0.3.0
- configreport: 0.1.1
- dav: 0.2.7
- federatedfilesharing: 0.3.0
- federation: 0.1.0
- files: 1.5.1
- files_external: 0.6.0
- files_pdfviewer: 0.8.1
- files_sharing: 0.10.0
- files_texteditor: 2.1
- files_trashbin: 0.9.0
- files_versions: 1.3.0
- files_videoplayer: 0.9.8
- firstrunwizard: 1.1
- gallery: 15.0.0
- notifications: 0.3.0
- provisioning_api: 0.5.0
- systemtags: 0.3.0
- templateeditor: 0.1
- updatenotification: 0.2.1
Disabled:
- documents
- encryption
- external
- files_antivirus
- files_mv
- ownnote
- search_lucene
- user_external
- user_ldap
Are you using external storage, if yes which one: none
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
Logs
Web server error log
[Wed Jun 28 15:58:35.981924 2017] [fastcgi:error] [pid 27677:tid 140233962153728] [client ***REMOVED IP***:59366] FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)
[Wed Jun 28 15:58:36.077825 2017] [fastcgi:error] [pid 27677:tid 140233962153728] [client ***REMOVED IP***:59366] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
ownCloud log (data/owncloud.log)
has no entries later than 2015-11
Browser log
preview.png:1 GET https://cloud.***REMOVED DOMAIN***/index.php/core/preview.png?file=%2FARCH…nsib_20061103.doc&c=17fee15952987395ab1da99701a3deda&x=32&y=32&forceIcon=0 404 (Not Found)
2017-07-01 17:43:23.868
preview.png:1 GET https://cloud.***REMOVED DOMAIN***/index.php/core/preview.png?file=%2FARCH…dagogique2008.pdf&c=da864a0fbf8cd5c6698a8cdd7cfab1cc&x=32&y=32&forceIcon=0 404 (Not Found)
2017-07-01 17:43:23.869
preview.png:1 GET https://cloud.***REMOVED DOMAIN***/index.php/core/preview.png?file=%2FARCH…ects%2F_codes.xls&c=f12a4d208f51b9178c5af72b1a0f4037&x=32&y=32&forceIcon=0 404 (Not Found)
2017-07-01 17:43:23.870
preview.png:1 GET https://cloud.***REMOVED DOMAIN***/index.php/core/preview.png?file=%2FARCH…jectAgreement.odt&c=90ede19f2629462d7e1b0725779360ab&x=32&y=32&forceIcon=0 404 (Not Found)
Activity
kwisatz commentedon Jul 2, 2017
Thanks @kdslkdsaldsal, it might be.
At least some of the referenced SQL queries return a load of entries in this case (597 to be exact).
But I'm not enough into owncloud to fully understand everything that @PVince81 is explaining in #28018 and #28238, so I can't be really sure.
kwisatz commentedon Jul 2, 2017
I just ran the repair command on the owncloud instance and at first it seemed to succeed:
root@server:/var/www/owncloud# sudo -u www-data ./occ maintenance:repair --include-expensive -vv - Repair file cache entries with path that does not match parent-child relationships 409/597 [===================>--------] 68% 55 secs/2 minsBut I'm not actually sure this is a good sign? It doesn't seem to want to stop and the total number of file cache entries to be repaired now increments with the "repaired" entries:
root@server:/var/www/owncloud# sudo -u www-data ./occ maintenance:repair --include-expensive -vv - Repair file cache entries with path that does not match parent-child relationships 770/770 [============================] 100% 2 mins/2 minsGood thing I dumped the DB before I ran this?!
kwisatz commentedon Jul 2, 2017
When I cancel (Ctrl-C) and restart, it starts at 0/579 again and shows the same behavior it did before. This might be interesting to @PVince81 too?
kwisatz commentedon Jul 2, 2017
Fun fact: It did actually fix the issue.
kwisatz commentedon Jul 2, 2017
Not entirely though. The files are showing up and the folders have been de-duplicated, but the files themselves are not accessible. E.g.
PVince81 commentedon Jul 3, 2017
@kwisatz thanks for testing. Can you rerun the queries I mentioned in the PR to see if there are still broken entries ?
select fc.storage,fc.fileid,fc.parent as "wrongparent",fc3.fileid "correctparent",fc.path,fc.etag from oc_filecache fc, oc_filecache fc3 where fc.parent <> -1 and fc.parent != fc3.fileid and fc3.storage=fc.storage and fc3.path = substring(fc.path, 1, length(fc.path) - length(substring_index(fc.path, '/', -1)) - 1) and not exists (select 1 from oc_filecache fc2 where fc2.fileid = fc.parent) order by path;select fc.storage,fc.fileid,fc.parent as "wrongparent",fc.path,fc.etag from oc_filecache fc where fc.parent <> -1 and not exists (select 1 from oc_filecache fc2 where fc2.fileid = fc.parent) order by path;select * from oc_filecache where parent=fileid;If none return results then there is likely yet another breakage style that needs to be adressed.
In that case it would be good to see the entries and parent entries of that specific file:
select * from oc_filecache where name='autorisation_2.pdf', pick the parent id then doselect * from oc_filecache where fileid=$parentIdreplace $parentId with the value of "parent" from the previous query. Then repeat for each section of the tree.PVince81 commentedon Jul 3, 2017
Note that you also need to apply #28022 to prevent the filecache breakage to be triggered in the first place. This PR
#28217#28253 is only to clean up the mess.kwisatz commentedon Jul 3, 2017
@PVince81 the first query still returns 145 rows; the second 180 rows and the last one returns an empty set. All of the files are still inaccessible though. I'm going to retrace parent IDs for one of them now and report back.
kwisatz commentedon Jul 3, 2017
In the meantime, here's the exception triggered when trying to access one of the files in this directory:
kwisatz commentedon Jul 3, 2017
@PVince81 I retraced the parentIDs and they seem OK. Each folder points to the respective parent folder and finally to parentId -1. I couldn't detect any inconsistencies here.
PVince81 commentedon Jul 3, 2017
@kwisatz try the following:
find data -name BUDGET_2016.pdfand see if the path matches the one from the error. I suspect the filecache had outdated entries that did not match what's on disk.occ files:scan --allto repair this.kwisatz commentedon Jul 3, 2017
@PVince81 the file has gone completely from the filesystem.
finddoesn't find any occurrence of it anymore. We will restore it from backup (provided it goes that far back, since I don't know when exactly the files vanished) and then re-scan the files.kwisatz commentedon Jul 3, 2017
We just restored that data from a backup (from the original location, since I don't think the files ever made it to the new directory) and now files are accessible again, even without running the scan command. (Though I started it anyway).
PVince81 commentedon Jul 3, 2017
@kwisatz please patch your system with #28238 and hopefully the inconsistency won't happen again. I'm closing this as duplicate then.
Glad to hear the repair worked for you.
lock commentedon Aug 1, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.