core icon indicating copy to clipboard operation
core copied to clipboard

Delete file fails

Open JochenHWezel opened this issue 9 years ago • 31 comments

I delete a file which only exists on owncloud web front (file itself seems to be already deleted on file server for some reason). The webfrontend displays an updated file listing without that file. Going back to parent directory and going back to the first directory, the file is in the directory listing again!

A failure in log file has NOT been logged. Only after switching log to everything, I get this entry:

Exception: {"Message":"HTTP\/1.1 404 File with name BEI Dienst Predigten\/Predigt-Entw\u00fcrfe Jochen\/Dropbox - Transfer.lnk could not be located","Exception":"Sabre\\DAV\\Exception\\NotFound","Code":0,"Trace":"#0 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php(178): OCA\\DAV\\Connector\\Sabre\\ObjectTree->getNodeForPath('BEI Dienst Pred...')\n#1 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(285): Sabre\\DAV\\Tree->delete('BEI Dienst Pred...')\n#2 [internal function]: Sabre\\DAV\\CorePlugin->httpDelete(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#3 \/var\/www\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#4 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:DELETE', Array)\n#5 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#6 \/var\/www\/owncloud\/apps\/dav\/appinfo\/v1\/webdav.php(56): Sabre\\DAV\\Server->exec()\n#7 \/var\/www\/owncloud\/remote.php(164): require_once('\/var\/www\/ownclo...')\n#8 {main}","File":"\/var\/www\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/ObjectTree.php","Line":170,"User":"jw"}

Expected behaviour:

  1. Web UI: delete errors in system lead to an error message confirmation box in UI directory listing that the file wasn't deleted and some error details
  2. A file pointer which points to a non-existing file at the owncloud server's file system should be deleted even if the filesystem is missing the file
  3. The above error message of the debug log should be fixed

JochenHWezel avatar Dec 18 '16 20:12 JochenHWezel

@JochenHWezel Please fill out the issue template shown when creating a new issue. Currently even the basic info about your environment is missing.

ghost avatar Dec 18 '16 21:12 ghost

Hello, I have the same problem with oc9.1.1, a folder supposed to be deleted still appears on web interface but no longer exists on server. [edit] This sub-folder is part of shared folder from another user. [/edit] I upgraded to 9.1.3 but Web UI still makes this folder visible and report this log message :

Steps to reproduce

Unfortunately, I don't know how to reproduce, it appends.

Server configuration

Operating system: Debian Wheezy up to date

Web server: Apache 2.2.22-13+deb7u7

Database: MySQL 5.5.46-0+deb7u1

PHP version: PHP 5.6.29-1~dotdeb+7.1

ownCloud version: 9.1.1 when error occurs, 9.1.3 now

Updated from an older ownCloud or fresh install: Fresh from 9.1.1

Where did you install ownCloud from: From owncloud server archive file (zip)

Signing status (ownCloud 9.0 and above):

No errors have been found.

List of activated apps:

# sudo -u www-data php occ app:list
Enabled:
  - activity: 2.3.2
  - calendar: 1.4.1
  - comments: 0.3.0
  - dav: 0.2.7
  - federatedfilesharing: 0.3.0
  - federation: 0.1.0
  - files: 1.5.1
  - 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
  - files_w2g: true
  - firstrunwizard: 1.1
  - gallery: 15.0.0
  - logreader: true
  - notifications: 0.3.0
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - templateeditor: 0.1
  - updatenotification: 0.2.1
Disabled:
  - encryption
  - external
  - files_antivirus
  - files_external
  - user_external
  - user_ldap

The content of config/config.php:

# sudo -u www-data php occ config:list system
{
    "system": {
        "instanceid": "ocvhfoo34wv1",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.customer.fr",
            "customer.owncloud.ovh"
        ],
        "datadirectory": "\/home\/cloud.customer.fr\/donnees",
        "overwrite.cli.url": "https:\/\/cloud.customer.fr",
        "dbtype": "mysql",
        "version": "9.1.3.1",
        "dbname": "cloudcustomer",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_from_address": "ne-pas-repondre",
        "mail_smtpmode": "php",
        "mail_domain": "cloud.customer.fr",
        "maintenance": false,
        "logfile": "\/home\/logs\/owncloud\/cloud.customer.fr.log",
        "loglevel": 2,
        "log_rotate_size": "20971520",
        "logtimezone": "Europe\/Berlin",
        "default_language": "fr",
        "minimum.supported.desktop.version": "1.7.0",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "forcessl": true,
        "appstoreenabled": true,
        "updatechecker": true
    }
}

Are you using external storage, if yes which one: No

Are you using encryption: No

Are you using an external user-backend, if yes which one: No

Logs

ownCloud log (data/owncloud.log)

{"reqId":"OWtUMgW5kEUMSAcbHjGl","remoteAddr":"109.190.199.43","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 404 File with name Commercial\\\/Plaquettes\\\/Fiches Techniques Trackers could not be located\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotFound\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/cloud.customer.fr\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(903): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath('Commercial\\\/Plaq...')\\n#1 \\\/home\\\/cloud.customer.fr\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(334): Sabre\\\\DAV\\\\Server->getPropertiesForPath('Commercial\\\/Plaq...', Array, 1)\\n#2 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPropFind(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#3 \\\/home\\\/cloud.customer.fr\\\/www\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#4 \\\/home\\\/cloud.customer.fr\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(459): Sabre\\\\Event\\\\EventEmitter->emit('method:PROPFIND', Array)\\n#5 \\\/home\\\/cloud.customer.fr\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(248): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#6 \\\/home\\\/cloud.customer.fr\\\/www\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(56): Sabre\\\\DAV\\\\Server->exec()\\n#7 \\\/home\\\/cloud.customer.fr\\\/www\\\/remote.php(164): require_once('\\\/home\\\/cloud.okw...')\\n#8 {main}\",\"File\":\"\\\/home\\\/cloud.customer.fr\\\/www\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ObjectTree.php\",\"Line\":170,\"User\":\"espritlibre\"}","level":0,"time":"2016-12-19T08:06:57+01:00","method":"PROPFIND","url":"\/remote.php\/webdav\/Commercial\/Plaquettes\/Fiches%20Techniques%20Trackers","user":"espritlibre"}

michel-thomas avatar Dec 19 '16 07:12 michel-thomas

Running occ files:scan --all should help resolve the inconsistency. Also in 9.1 it should be possible to delete such "ghost" files already in the web UI.

PVince81 avatar Dec 19 '16 09:12 PVince81

I already tried running php console.php files:scan --path="/User/files/Commercial/Plaquettes without success, folders still remains visible on Web UI. Also, scanning all files will take very long time... What is the difference between occ command and using console.php? Thanks for you help

michel-thomas avatar Dec 19 '16 10:12 michel-thomas

Ok, tested with the exact command occ files:scan --all and folders does not disappear on Web UI. Same error in logs when cliking on it.

michel-thomas avatar Dec 19 '16 11:12 michel-thomas

Hmm, strange... scanning usually resolves that problem. Let's reformat the stack trace:

{"reqId":"OWtUMgW5kEUMSAcbHjGl","remoteAddr":"109.190.199.43","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 404 File with name Commercial\\\/Plaquettes\\\/Fiches Techniques Trackers could not be located\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotFound\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/cloud.customer.fr\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(903): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath('Commercial\\\/Plaq...')\\n
#1 \\\/home\\\/cloud.customer.fr\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(334): Sabre\\\\DAV\\\\Server->getPropertiesForPath('Commercial\\\/Plaq...', Array, 1)\\n
#2 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPropFind(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n
#3 \\\/home\\\/cloud.customer.fr\\\/www\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n
#4 \\\/home\\\/cloud.customer.fr\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(459): Sabre\\\\Event\\\\EventEmitter->emit('method:PROPFIND', Array)\\n
#5 \\\/home\\\/cloud.customer.fr\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(248): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n
#6 \\\/home\\\/cloud.customer.fr\\\/www\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(56): Sabre\\\\DAV\\\\Server->exec()\\n
#7 \\\/home\\\/cloud.customer.fr\\\/www\\\/remote.php(164): require_once('\\\/home\\\/cloud.okw...')\\n
#8 {main}\",\"File\":\"\\\/home\\\/cloud.customer.fr\\\/www\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ObjectTree.php\",\"Line\":170,\"User\":\"espritlibre\"}","level":0,"time":"2016-12-19T08:06:57+01:00","method":"PROPFIND","url":"\/remote.php\/webdav\/Commercial\/Plaquettes\/Fiches%20Techniques%20Trackers","user":"espritlibre"}

PVince81 avatar Dec 19 '16 11:12 PVince81

@esprit-libre when deleting from the web UI, you should see a "DELETE" request in the network console of the browser and also a matching log entry. Can you see if you can find that ?

The log entry above is from a separate PROPFIND request, not from a failing deletion. Would be good to see what the DELETE call says.

PVince81 avatar Dec 19 '16 11:12 PVince81

btw, I see you're using a memcache. You might want to try clearing that in case there are remains.

PVince81 avatar Dec 19 '16 11:12 PVince81

I use OwnCloud v9.1.3 (stable) on Ubuntu 16.04.1 LTS with most current updates.

root@beiweb01:/var/www/owncloud# sudo -u www-data php occ app:list
Enabled:
  - activity: 2.3.2
  - comments: 0.3.0
  - 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
  - user_ldap: 0.9.0
Disabled:
  - calendar
  - documents
  - encryption
  - external
  - files_antivirus
  - user_external

The file is located in a folder structure shared by another user to me.

JochenHWezel avatar Dec 19 '16 17:12 JochenHWezel

Also for me, this suggestion didn't work:

occ files:scan --all

This is the owncloud.log entry created only on debug-everything:

{"reqId":"W1U0DDvK8gENlGrBJFEG","remoteAddr":"192.168.32.104","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 404 File with name BEI Dienst Predigten\\\/Predigt-Entw\\u00fcrfe Jochen\\\/Dropbox - Transfer.lnk could not be located\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotFound\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(178): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath('BEI Dienst Pred...')\\n#1 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(285): Sabre\\\\DAV\\\\Tree->delete('BEI Dienst Pred...')\\n#2 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpDelete(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#3 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#4 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(459): Sabre\\\\Event\\\\EventEmitter->emit('method:DELETE', Array)\\n#5 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(248): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#6 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(56): Sabre\\\\DAV\\\\Server->exec()\\n#7 \\\/var\\\/www\\\/owncloud\\\/remote.php(164): require_once('\\\/var\\\/www\\\/ownclo...')\\n#8 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ObjectTree.php\",\"Line\":170,\"User\":\"jw\"}","level":0,"time":"2016-12-19T18:10:22+00:00","method":"DELETE","url":"\/owncloud\/remote.php\/webdav\/BEI%20Dienst%20Predigten\/Predigt-Entw%C3%BCrfe%20Jochen\/Dropbox%20-%20Transfer.lnk","user":"jw"}

This is what the browser presents: image

image

These are additional logs which might be helpful: image

JochenHWezel avatar Dec 19 '16 18:12 JochenHWezel

Here some additional owncloud logs which might help:

{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cli","message":"Memcache \\OC\\Memcache\\APCu not available for local cache","level":1,"time":"2016-12-19T18:15:01+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cli","message":"Memcache \\OC\\Memcache\\APCu not available for distributed cache","level":1,"time":"2016-12-19T18:15:01+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\DAV\\CardDAV\\SyncJob job with ID 1","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\DAV\\CardDAV\\SyncJob job with ID 1","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\Federation\\SyncJob job with ID 2","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\Federation\\SyncJob job with ID 2","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\Files\\BackgroundJob\\DeleteOrphanedItems job with ID 6","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\Files\\BackgroundJob\\DeleteOrphanedItems job with ID 6","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\Files\\BackgroundJob\\CleanupFileLocks job with ID 7","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\Files\\BackgroundJob\\CleanupFileLocks job with ID 7","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\Files_Versions\\BackgroundJob\\ExpireVersions job with ID 8","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\Files_Versions\\BackgroundJob\\ExpireVersions job with ID 8","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\Activity\\BackgroundJob\\EmailNotification job with ID 9","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\Activity\\BackgroundJob\\EmailNotification job with ID 9","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\Activity\\BackgroundJob\\ExpireActivities job with ID 10","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\Activity\\BackgroundJob\\ExpireActivities job with ID 10","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrash job with ID 11","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrash job with ID 11","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OC\\BackgroundJob\\Legacy\\RegularJob job with ID 14","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OC\\BackgroundJob\\Legacy\\RegularJob job with ID 14","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OC\\Authentication\\Token\\DefaultTokenCleanupJob job with ID 16","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"no app in context","message":"Invalidating tokens older than 2016-12-18T18:15:02+00:00","level":1,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OC\\Authentication\\Token\\DefaultTokenCleanupJob job with ID 16","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\UpdateNotification\\Notification\\BackgroundJob job with ID 17","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\UpdateNotification\\Notification\\BackgroundJob job with ID 17","level":0,"time":"2016-12-19T18:15:02+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\User_LDAP\\Jobs\\UpdateGroups job with ID 18","level":0,"time":"2016-12-19T18:15:03+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\User_LDAP\\Jobs\\UpdateGroups job with ID 18","level":0,"time":"2016-12-19T18:15:03+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\User_LDAP\\Jobs\\CleanUp job with ID 19","level":0,"time":"2016-12-19T18:15:03+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\User_LDAP\\Jobs\\CleanUp job with ID 19","level":0,"time":"2016-12-19T18:15:03+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\Files_Sharing\\DeleteOrphanedSharesJob job with ID 22","level":0,"time":"2016-12-19T18:15:03+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\Files_Sharing\\DeleteOrphanedSharesJob job with ID 22","level":0,"time":"2016-12-19T18:15:03+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\Files\\BackgroundJob\\ScanFiles job with ID 5","level":0,"time":"2016-12-19T18:15:03+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path '' is not accessible or present !!!","level":0,"time":"2016-12-19T18:15:03+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path '' is not accessible or present !!!","level":0,"time":"2016-12-19T18:15:03+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path '' is not accessible or present !!!","level":0,"time":"2016-12-19T18:15:03+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\Files\\BackgroundJob\\ScanFiles job with ID 5","level":0,"time":"2016-12-19T18:15:04+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Run OCA\\Files_Sharing\\ExpireSharesJob job with ID 23","level":0,"time":"2016-12-19T18:15:04+00:00","method":"--","url":"--","user":"--"}
{"reqId":"th++GXOkJwYfJGfmI077","remoteAddr":"","app":"cron","message":"Finished OCA\\Files_Sharing\\ExpireSharesJob job with ID 23","level":0,"time":"2016-12-19T18:15:04+00:00","method":"--","url":"--","user":"--"}

JochenHWezel avatar Dec 19 '16 18:12 JochenHWezel

Ok, thanks for the details.

Let's check the database: select * from oc_filecache where path like "%Dropbox - Transfer%". I expect that this entry still exist in the database but there is no such matching file inside the "data" folder.

Now another question is whether only this file is gone or all the parent folders are gone too inside the "data" folder ?

Locally I've tested on 9.1.3 the following steps:

  1. Create a file "test.txt" in the web UI
  2. Go to the data folder and directly delete "test.txt"
  3. Refresh the web UI: see the file still appears
  4. Delete "test.txt" => no error, file is gone.

So I suspect there is something else at play.

PVince81 avatar Dec 19 '16 18:12 PVince81

Hello, here is the SQL request: mysql> select fileid, path, permissions, parent, mimetype from oc_filecache where path like "%Techniques Trackers%"; +--------+-------------------------------------------------------------------------------------------+-------------+--------+----------+ | fileid | path | permissions | parent | mimetype | +--------+-------------------------------------------------------------------------------------------+-------------+--------+----------+ | 1856 | files/Partage/Plaquettes/Fiches Techniques Trackers | 31 | 1829 | 2 | | 1964 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 110m² 260Wc - v1.pdf | 27 | 1856 | 4 | | 1965 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 110m² 260Wc - v1.jpg | 27 | 1856 | 6 | | 1966 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 110m² 285Wc - v1.jpg | 27 | 1856 | 6 | | 1967 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 110m² 285Wc - v1.pdf | 27 | 1856 | 4 | | 1968 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 1er page.pdf | 27 | 1856 | 4 | | 1969 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 20m² - v1.jpg | 27 | 1856 | 6 | | 1970 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 1er page.jpg | 27 | 1856 | 6 | | 1971 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 20m² - v1.pdf | 27 | 1856 | 4 | | 1972 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 40m² - v1.jpg | 27 | 1856 | 6 | | 1973 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 40m² - v1.pdf | 27 | 1856 | 4 | | 1974 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 60m² 260Wc - v1.pdf | 27 | 1856 | 4 | | 1975 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 60m² 260Wc - v1.jpg | 27 | 1856 | 6 | | 1976 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 60m² 285Wc - v1.pdf | 27 | 1856 | 4 | | 1977 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 60m² 285Wc - v1.jpg | 27 | 1856 | 6 | | 1978 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 80m² 260Wc - v1.jpg | 27 | 1856 | 6 | | 1979 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 80m² 260Wc - v1.pdf | 27 | 1856 | 4 | | 1980 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 80m² 285Wc - v1.jpg | 27 | 1856 | 6 | | 1981 | files/Partage/Plaquettes/Fiches Techniques Trackers/fiche technique 80m² 285Wc - v1.pdf | 27 | 1856 | 4 | +--------+-------------------------------------------------------------------------------------------+-------------+--------+----------+ 19 rows in set (0.01 sec)

As you can read folders and files are still present in database. I received some additional information from the user concerned:

  • the folders are shared by a user with "suppress" rights disabled (only create and modify are allowed)
  • so deletion can be tried only by the owner
  • special app that can be linked: files_w2g (https://apps.owncloud.com/content/show.php/Workin2gether+(files_w2g)?content=164016)

I tried to reproduce without success.

michel-thomas avatar Dec 20 '16 18:12 michel-thomas

This is the result of MySQL:

mysql> mysql> select * from oc_filecache where path like "%Dropbox - Transfer%";
+--------+---------+---------------------------------------------------------------------------------------------+----------------------------------+--------+------------------------------------+----------+----------+------+------------+---------------+-----------+------------------+----------------------------------+-------------+----------+
| fileid | storage | path                                                                                        | path_hash                        | parent | name                               | mimetype | mimepart | size | mtime      | storage_mtime | encrypted | unencrypted_size | etag                             | permissions | checksum |
+--------+---------+---------------------------------------------------------------------------------------------+----------------------------------+--------+------------------------------------+----------+----------+------+------------+---------------+-----------+------------------+----------------------------------+-------------+----------+
|  24984 |       1 | files/BEI Allgemein/Gottesdienste/Predigten/Predigt-Entwürfe Jochen/Dropbox - Transfer.lnk  | cd6a0c2c7a609f4a1186f0e7a34342bd |   9180 | Dropbox - Transfer.lnk             |        7 |        5 | 1137 | 1472895342 |    1472895342 |         0 |                0 | c2cb7db6f8dc6e8ea7da9aac5b1bd59a |          27 |          |
|  27366 |       1 | files_trashbin/files/Dropbox - Transfer.lnk.d1476520535                                     | e07c3b52b9fe0e191c3734c2c6c08b62 |   5290 | Dropbox - Transfer.lnk.d1476520535 |        7 |        5 | 1137 | 1474189752 |    1474189752 |         0 |                0 | 815e47d6e356942923c931e6af8bff48 |          27 |          |
|  27369 |       3 | files_trashbin/files/Dropbox - Transfer.lnk.d1476520535                                     | e07c3b52b9fe0e191c3734c2c6c08b62 |  27222 | Dropbox - Transfer.lnk.d1476520535 |        7 |        5 | 1137 | 1474189752 |    1474189752 |         0 |                0 | 7d4550b8254adb0acc9d3b3e74366472 |          27 |          |
+--------+---------+---------------------------------------------------------------------------------------------+----------------------------------+--------+------------------------------------+----------+----------+------+------------+---------------+-----------+------------------+----------------------------------+-------------+----------+
3 rows in set (0,07 sec)

Now another question is whether only this file is gone or all the parent folders are gone too inside the "data" folder ?

There are about 2 files in the folder with this problem. Other additional files in the same folder are still available.

JochenHWezel avatar Dec 20 '16 19:12 JochenHWezel

The workaround would be to manually delete these obsoleted entries. But I don't understand why occ files:scan doesn't do it automatically on your environment.

PVince81 avatar Dec 21 '16 07:12 PVince81

Ok. Strange. Only oc_filecache table is concerned ? Thanks for your help

michel-thomas avatar Dec 21 '16 07:12 michel-thomas

@PVince81 how can I support you with more material for your analysis? (Or would you like to take a look into the full database?) Or how to step further on this issue?

JochenHWezel avatar Dec 28 '16 19:12 JochenHWezel

Hi, I can confirm that this issue is present even in OC 8.2. I have seen the following SQL exception when DELETE of the file fails for the first time:

"app":"webdav","message":"Exception:
{\"Message\":\"An exception occurred while executing 'UPDATE \\\"oc_filecache\\\" SET \\\"storage\\\" =  ?, \\\"path\\\" = ?, \\\"path_hash\\\" = ?, \\\"name\\\" = ?, \\\"parent\\\" =? WHERE \\\"fileid\\\" = ?' with params
[7572, \\\"files_trashbin\\\\\\\/files\\\\\\\/obfuscated.d1483099861\\\", \\\"974a8e7377fd148b0d042606a16db537\\\", \\\"obfuscated.d1483099861\\\", 147658637, 158461934]:
SQLSTATE[23505]: Unique violation: 7 ERROR:  duplicate key value violates unique constraint \\\"fs_storage_path_hash\\\"
DETAIL:  Key (storage, path_hash)=(7572, 974a8e7377fd148b0d042606a16db537) already exists.\",
\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\UniqueConstraintViolationException\",\"Code\":0,\"Trace\":\"
#0 \\\/owncloud\\\/web\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(116): Doctrine\\\\DBAL\\\\Driver\\\\AbstractPostgreSQLDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))
#1 \\\/owncloud\\\/web\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Statement.php(172): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOPgSql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'UPDATE \\\"oc_file...', Array)
#2 \\\/owncloud\\\/web\\\/lib\\\/private\\\/db\\\/statementwrapper.php(73): Doctrine\\\\DBAL\\\\Statement->execute(Array)
#3 \\\/owncloud\\\/web\\\/lib\\\/private\\\/db.php(147): OC_DB_StatementWrapper->execute(Array)
#4 \\\/owncloud\\\/web\\\/lib\\\/private\\\/files\\\/cache\\\/cache.php(500): OC_DB::executeAudited('UPDATE `*PREFIX...', Array)
#5 \\\/owncloud\\\/web\\\/lib\\\/private\\\/files\\\/cache\\\/cache.php(447): OC\\\\Files\\\\Cache\\\\Cache->moveFromCache(Object(OC\\\\Files\\\\Cache\\\\HomeCache), 'files\\\/P...', 'files_trashbin\\\/...')
#6 \\\/owncloud\\\/web\\\/lib\\\/private\\\/files\\\/cache\\\/updater.php(198): OC\\\\Files\\\\Cache\\\\Cache->move('files\\\/P...', 'files_trashbin\\\/...')
#7 \\\/owncloud\\\/web\\\/apps\\\/files_trashbin\\\/lib\\\/trashbin.php(225): OC\\\\Files\\\\Cache\\\\Updater->rename('\\\/files\\\/...', '\\\/files_trashbin...')
#8 \\\/owncloud\\\/web\\\/apps\\\/files_trashbin\\\/lib\\\/storage.php(160): OCA\\\\Files_Trashbin\\\\Trashbin::move2trash('Pro/...')
#9 \\\/owncloud\\\/web\\\/apps\\\/files_trashbin\\\/lib\\\/storage.php(95): OCA\\\\Files_Trashbin\\\\Storage->doDelete('files\\\/P...', 'unlink')
#10 \\\/owncloud\\\/web\\\/lib\\\/private\\\/files\\\/view.php(1024): OCA\\\\Files_Trashbin\\\\Storage->unlink('files\\\/P...')
#11 \\\/owncloud\\\/web\\\/lib\\\/private\\\/files\\\/view.php(605): OC\\\\Files\\\\View->basicOperation('unlink', '\\\/Pro...', Array)
#12 \\\/owncloud\\\/web\\\/lib\\\/private\\\/connector\\\/sabre\\\/file.php(313): OC\\\\Files\\\\View->unlink('/Pro...')
#13 \\\/owncloud\\\/web\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(179): OC\\\\Connector\\\\Sabre\\\\File->delete()
#14 \\\/owncloud\\\/web\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(287): Sabre\\\\DAV\\\\Tree->delete('\\\/Pro...')
#15 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpDelete(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))
#16 \\\/owncloud\\\/web\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)
#17 \\\/owncloud\\\/web\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(469): Sabre\\\\Event\\\\EventEmitter->emit('method:DELETE', Array)
#18 \\\/owncloud\\\/web\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))
#19 \\\/owncloud\\\/web\\\/apps\\\/files\\\/appinfo\\\/remote.php(56): Sabre\\\\DAV\\\\Server->exec()
#20 \\\/owncloud\\\/web\\\/remote.php(137): require_once('\\\/owncloud\\\/...')
#21 {main}\",\"File\":\"\\\/owncloud\\\/web\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractPostgreSQLDriver.php\",\"Line\":63}",
"level":4,"time":"2016-12-30T13:11:01+01:00","method":"DELETE","url":"\/remote.php\/webdav\/Pro\/ofuscated"}

Relevant apache logs:

[30/Dec/2016:13:11:01 +0100] "DELETE /remote.php/webdav/Pro/obfuscated HTTP/1.1" 500 749 "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 6408)" 0 1133 1664 312365
[30/Dec/2016:13:11:01 +0100] "DELETE /remote.php/webdav/Pro/My%20dir/obfuscated HTTP/1.1" 204 - "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 6408)" 1 557 763 482456
[30/Dec/2016:13:12:00 +0100] "DELETE /remote.php/webdav/Pro/obfuscated HTTP/1.1" 403 193 "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 6408)" 4 544 992 259291

Directory listing on web frontend logs that 'Could not locate file exception'. Clients trying to delete the file do always receive a 403 Forbidden exception. Filecache contains only one single entry for the file:

owncloud=# SELECT * FROM oc_filecache WHERE name LIKE '%obfuscated%';
  fileid   | storage |                     path                      |            path_hash             |  parent   |      name        | mimetype | mimepart |  size  |   mtime    | storage_mtime | encrypted | unencrypted_size |               etag               | permissions 
-----------+---------+-----------------------------------------------+----------------------------------+-----------+------------------+----------+----------+--------+------------+---------------+-----------+------------------+----------------------------------+-------------
 158461934 |    7572 | files/Pro/obfuscated | c029d986c1557b8aa735e2935ecaf930 | 147407588 | obfuscated |       10 |        3 | 305958 | 1483099173 |    1483099173 |         0 |                0 | 53ece7a34b42d8eac5ebca339d676b71 |          27

It doesn't exist anywhere on the filesystem (even in files_trashbin). Haven't tried rescan of files yet, but will try it soon. Possibly could also be related to #23151 .

mirekys avatar Jan 02 '17 13:01 mirekys

I need to find time to try and reproduce this issue locally with the provided steps...

@mirekys @esprit-libre can you confirm that your issue is 100% the same as @JochenHWezel ? Do you also have the app "working2gether" enabled ? The more info about your setups, the more we can cross-relate similarities and find out why this is happening.

PVince81 avatar Jan 09 '17 09:01 PVince81

I confirm that I had the same issue, with workin2gether enabled. You have my config detail above. I can also indicate that manually cleaning oc_filecache solve the issue. I don't have new use case since the one I declared.

michel-thomas avatar Jan 09 '17 10:01 michel-thomas