Repository navigation
Description
Steps to reproduce
- Upload a folder with 5 subfolders with some files inside each folder using web ui.
- Upload again the same folder. When conflicts are detected say no.
- Upload again the same folder.
- Refresh the page.
- Duplicate a file in one of the subfolders to upload.
- Upload again the same folder.
Expected behaviour
The upload detects that it is an overwrite and asks if the folder should upload again the files.
Showing the conflicts.
Actual behaviour
The behaviour is erratic, sometimes the upload is just ignored, other it warns you with an upload cancelled warning. And others it simply fails this way:
Server configuration
Operating system:
Ubuntu 16.04
Web server:
Apache
Database:
MySQL
PHP version:
7.0
Cache
DB
ownCloud version: (see ownCloud admin page)
(master)
{"installed":"true","maintenance":"false","needsDbUpgrade":"false","version":"10.0.3.0","versionstring":"10.0.3 beta","edition":"Community","productname":"ownCloud"}
Patch 28692 was applied while testing this, no changes.
Updated from an older ownCloud or fresh install:
Fresh
The content of config/config.php:
Are you using external storage, if yes which one: local/smb/sftp/...
No.
Are you using encryption:
No.
Logs
{"reqId":"x1tj5Uy8ZLORpNhi9ncN","level":4,"time":"2017-08-29T16:00:07+00:00","remoteAddr":"HIDDEN_IP","user":"admin","app":"webdav","method":"MKCOL","url":"\/remote.php\/dav\/files\/admin\/VARIAS_CARPETAS","message":"Exception: {\"Message\":\"HTTP\\\/1.1 405 The resource you tried to create already exists\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\MethodNotAllowed\",\"Code\":0,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(590): Sabre\\\\DAV\\\\Server->createCollection('files\\\/admin\\\/VAR...', Object(Sabre\\\\DAV\\\\MkCol))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMkcol(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MKCOL', Array)\\n#4 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(234): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#7 \\\/opt\\\/owncloud\\\/remote.php(175): require_once('\\\/opt\\\/owncloud\\\/a...')\\n#8 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":1180,\"User\":\"admin\"}"}
{"reqId":"4P7jap1fLtnJHWo3MgXc","level":4,"time":"2017-08-29T16:00:07+00:00","remoteAddr":"HIDDEN_IP","user":"admin","app":"webdav","method":"MKCOL","url":"\/remote.php\/dav\/files\/admin\/VARIAS_CARPETAS\/carpeta2","message":"Exception: {\"Message\":\"HTTP\\\/1.1 405 The resource you tried to create already exists\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\MethodNotAllowed\",\"Code\":0,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(590): Sabre\\\\DAV\\\\Server->createCollection('files\\\/admin\\\/VAR...', Object(Sabre\\\\DAV\\\\MkCol))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMkcol(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MKCOL', Array)\\n#4 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(234): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#7 \\\/opt\\\/owncloud\\\/remote.php(175): require_once('\\\/opt\\\/owncloud\\\/a...')\\n#8 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":1180,\"User\":\"admin\"}"}
{"reqId":"4cKZsoYQ4iMM2LPSpMgZ","level":4,"time":"2017-08-29T16:00:07+00:00","remoteAddr":"HIDDEN_IP","user":"admin","app":"webdav","method":"MKCOL","url":"\/remote.php\/dav\/files\/admin\/VARIAS_CARPETAS\/carpeta1","message":"Exception: {\"Message\":\"HTTP\\\/1.1 405 The resource you tried to create already exists\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\MethodNotAllowed\",\"Code\":0,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(590): Sabre\\\\DAV\\\\Server->createCollection('files\\\/admin\\\/VAR...', Object(Sabre\\\\DAV\\\\MkCol))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMkcol(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MKCOL', Array)\\n#4 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(234): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#7 \\\/opt\\\/owncloud\\\/remote.php(175): require_once('\\\/opt\\\/owncloud\\\/a...')\\n#8 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":1180,\"User\":\"admin\"}"}
{"reqId":"bAIGsHcDGyuwYFkkIPDt","level":4,"time":"2017-08-29T16:00:07+00:00","remoteAddr":"HIDDEN_IP","user":"admin","app":"webdav","method":"MKCOL","url":"\/remote.php\/dav\/files\/admin\/VARIAS_CARPETAS\/carpeta4","message":"Exception: {\"Message\":\"HTTP\\\/1.1 405 The resource you tried to create already exists\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\MethodNotAllowed\",\"Code\":0,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(590): Sabre\\\\DAV\\\\Server->createCollection('files\\\/admin\\\/VAR...', Object(Sabre\\\\DAV\\\\MkCol))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMkcol(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MKCOL', Array)\\n#4 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(234): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#7 \\\/opt\\\/owncloud\\\/remote.php(175): require_once('\\\/opt\\\/owncloud\\\/a...')\\n#8 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":1180,\"User\":\"admin\"}"}
{"reqId":"E0iMeHpKvR7wmV84NuHc","level":4,"time":"2017-08-29T16:00:07+00:00","remoteAddr":"HIDDEN_IP","user":"admin","app":"webdav","method":"MKCOL","url":"\/remote.php\/dav\/files\/admin\/VARIAS_CARPETAS\/carpeta3","message":"Exception: {\"Message\":\"HTTP\\\/1.1 405 The resource you tried to create already exists\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\MethodNotAllowed\",\"Code\":0,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(590): Sabre\\\\DAV\\\\Server->createCollection('files\\\/admin\\\/VAR...', Object(Sabre\\\\DAV\\\\MkCol))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMkcol(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MKCOL', Array)\\n#4 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(234): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#7 \\\/opt\\\/owncloud\\\/remote.php(175): require_once('\\\/opt\\\/owncloud\\\/a...')\\n#8 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":1180,\"User\":\"admin\"}"}
{"reqId":"GBBnt6UVzyulA1SzA2iL","level":4,"time":"2017-08-29T16:00:07+00:00","remoteAddr":"HIDDEN_IP","user":"admin","app":"webdav","method":"MKCOL","url":"\/remote.php\/dav\/files\/admin\/VARIAS_CARPETAS\/carpeta5","message":"Exception: {\"Message\":\"HTTP\\\/1.1 405 The resource you tried to create already exists\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\MethodNotAllowed\",\"Code\":0,\"Trace\":\"#0 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(590): Sabre\\\\DAV\\\\Server->createCollection('files\\\/admin\\\/VAR...', Object(Sabre\\\\DAV\\\\MkCol))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMkcol(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MKCOL', Array)\\n#4 \\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(234): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/opt\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#7 \\\/opt\\\/owncloud\\\/remote.php(175): require_once('\\\/opt\\\/owncloud\\\/a...')\\n#8 {main}\",\"File\":\"\\\/opt\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":1180,\"User\":\"admin\"}"}
Client configuration
Browser
Chrome, Firefox

Activity
PVince81 commentedon Sep 1, 2017
I think this never worked properly...
PVince81 commentedon Sep 4, 2017
@SergioBertolinSG not reproducible on master 7c7e4f9
It is likely that some other of my related PRs fixed it. Can you verify ?
SergioBertolinSG commentedon Sep 5, 2017
Testing in current master, the step 2 simply doesn't happen. When uploading again the folder, it is not detected as an overwrite.
PVince81 commentedon Sep 5, 2017
In my test it worked. I dragged a folder from dolphin (file manager) into the current folder.
Did you drag onto a subfolder maybe ?
SergioBertolinSG commentedon Sep 5, 2017
I do this (on current master):
22 remaining items
felixboehm commentedon Oct 17, 2017
We get this fixed for 10.0.4 ?
PVince81 commentedon Oct 17, 2017
Yes, still on my list
PVince81 commentedon Oct 30, 2017
If I remove the copy logic and have it just a reference, it's even worse: the internal events are triggered in a cyclic manner
PVince81 commentedon Oct 30, 2017
Okay, after digging into the code I found the following: the upload id that is generated doesn't properly include the target upload folder but just the name.
So if you're trying to upload multiple files with the same name but into different folders, it would cause an upload id conflict and mess up when all is done in parallel.
PVince81 commentedon Oct 30, 2017
Seems the upload id is not the problem here as there was an appended timestamp. I'll still provide a fix for this as high concurrency could cause upload id collisions if the timestamp is exactly the same.
There is another problem remaining: at the time of the
doneevent, the uploads array is already empty as if it was cleared.PVince81 commentedon Oct 30, 2017
This is very random. I have the feeling that sometimes one piece of the upload batch finishes earlier and calls
clear(), which disturbs the other not yet sent pieces.The weird thing is that when I add logging to try and reproduce this, it doesn't happen.
clear()is then always called at the end instead of somewhere in the middle...PVince81 commentedon Oct 30, 2017
Ok, I managed to observe this race condition with logging.
Sometimes it happens that the first items of the transfer finish early and fast, so that there are no more "submitted" items in jquery.fileupload's queue, so it fires "fileuploadstop" which marks the end of the transfer. "fileuploadstop" would simply clear the list of known uploads.
However we still have a list of unprocessed uploads, so I've adjusted the
clear()method to keep pending uploads instead of clearing them all.PR incoming soon.
PVince81 commentedon Oct 30, 2017
Ah, I also wanted to mention that I noticed this behavior when reuploading the same folder within the same page. It almost feels like Chrome is caching the files somewhere so the second upload is much faster, but also more prone to trigger this race condition. This happens even if you upload into a second separate folder.
This likely matches somehow what @SergioBertolinSG observed, except that he reuploaded into the same folder while I uploaded to a second folder.
PVince81 commentedon Oct 30, 2017
@SergioBertolinSG please retest with #29393
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.