Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwriting populated folders using web ui leads to errors and unexpected behaviour. #28844

Closed
SergioBertolinSG opened this issue Aug 29, 2017 · 36 comments · Fixed by #29393
Closed
Assignees
Labels
p2-high Escalation, on top of current planning, release blocker QA:known sev2-high status/STALE Type:Bug
Milestone

Comments

@SergioBertolinSG
Copy link
Contributor

Steps to reproduce

  1. Upload a folder with 5 subfolders with some files inside each folder using web ui.
  2. Upload again the same folder. When conflicts are detected say no.
  3. Upload again the same folder.
  4. Refresh the page.
  5. Duplicate a file in one of the subfolders to upload.
  6. 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:

screen shot 2017-08-29 at 17 50 10

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

@SergioBertolinSG SergioBertolinSG added Type:Bug p2-high Escalation, on top of current planning, release blocker sev2-high labels Aug 29, 2017
@SergioBertolinSG SergioBertolinSG added this to the QA milestone Aug 29, 2017
@PVince81 PVince81 self-assigned this Sep 1, 2017
@PVince81
Copy link
Contributor

PVince81 commented Sep 1, 2017

I think this never worked properly...

@felixboehm felixboehm modified the milestones: QA, development Sep 4, 2017
@PVince81
Copy link
Contributor

PVince81 commented 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
Copy link
Contributor Author

SergioBertolinSG commented 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
Copy link
Contributor

PVince81 commented 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
Copy link
Contributor Author

SergioBertolinSG commented Sep 5, 2017

I do this (on current master):

overwriting_folders_doesnthappen

@PVince81
Copy link
Contributor

PVince81 commented Sep 5, 2017

oh, so you too see "infinite years"...

@PVince81
Copy link
Contributor

PVince81 commented Sep 5, 2017

stable10 for me:
output

@PVince81
Copy link
Contributor

PVince81 commented Sep 5, 2017

Works for me, see above. Note that the 412 errors are expected, it's the conflict detection that will trigger the conflict dialog.

@SergioBertolinSG
Copy link
Contributor Author

I get 405s
like this for example:
Request Method:MKCOL
Status Code:405 Method Not Allowed

@SergioBertolinSG
Copy link
Contributor Author

In your gif some 405s appear as well.

@PVince81
Copy link
Contributor

PVince81 commented Sep 5, 2017

Yes, these are expected too: we try to create the folder and the server tells us that it already exists with 405, so we skip it. This saves a server call, because the alternative would be to do two requests: one PROPFIND and then if 404 comes, do a MKCOL, which might also fail if someone created the folder between the two calls. This is Webdav.

@PVince81
Copy link
Contributor

PVince81 commented Sep 5, 2017

@PVince81
Copy link
Contributor

PVince81 commented Sep 6, 2017

@SergioBertolinSG can you clear the cache and try again ?

@SergioBertolinSG
Copy link
Contributor Author

Still happening.

@PVince81
Copy link
Contributor

PVince81 commented Sep 6, 2017

Ok, I was able to reproduce it with @SergioBertolinSG's carpets folders but my folders don't cause the issues

@PVince81
Copy link
Contributor

PVince81 commented Sep 6, 2017

There is something weird happening: the first upload goes through and the fail() method is properly able to find the upload status 412 to display the conflict dialog.

But the second upload, while it goes through fail(), somehow doesn't find the upload object so it cannot find the upload status. This is why the message appears in the notification.

Now to find out why this is happening... Maybe some cached stuff from the previous upload

@PVince81
Copy link
Contributor

PVince81 commented Sep 6, 2017

Ok, looks like there are zombie past uploads.

I checked the state inside of fail() and the contents of data is not the same as upload.data.
data contains the correct data with the jqXHR object which has the correct status.
However upload.data.jqXHR contains a weird dead jQuery XHR object without status.

Normally when creating a new upload, the upload object simply receives the new data.
Need to investigate why it's not happening here.

@PVince81
Copy link
Contributor

PVince81 commented Sep 6, 2017

and the weirdest part, it always only happens with @SergioBertolinSG's folder structure:

VARIAS_CARPETAS
VARIAS_CARPETAS/.DS_Store
VARIAS_CARPETAS/carpeta1
VARIAS_CARPETAS/carpeta1/.DS_Store
VARIAS_CARPETAS/carpeta1/parda copy 2.jpg
VARIAS_CARPETAS/carpeta1/parda copy.jpg
VARIAS_CARPETAS/carpeta1/parda.jpg
VARIAS_CARPETAS/carpeta1/s_033 copy.png
VARIAS_CARPETAS/carpeta1/s_033.png
VARIAS_CARPETAS/carpeta1/the_binding_of_isaac__the_duke_of_flies_by_applesanimatics-d6r52yw.jpg
VARIAS_CARPETAS/carpeta1/vikings-episode-4-trial copy 2.jpg
VARIAS_CARPETAS/carpeta1/vikings-episode-4-trial copy.jpg
VARIAS_CARPETAS/carpeta1/vikings-episode-4-trial.jpg
VARIAS_CARPETAS/carpeta2
VARIAS_CARPETAS/carpeta2/.DS_Store
VARIAS_CARPETAS/carpeta2/parda.jpg
VARIAS_CARPETAS/carpeta2/s_033.png
VARIAS_CARPETAS/carpeta2/the_binding_of_isaac__the_duke_of_flies_by_applesanimatics-d6r52yw.jpg
VARIAS_CARPETAS/carpeta2/vikings-episode-4-trial.jpg
VARIAS_CARPETAS/carpeta3
VARIAS_CARPETAS/carpeta3/.DS_Store
VARIAS_CARPETAS/carpeta3/parda.jpg
VARIAS_CARPETAS/carpeta3/s_033.png
VARIAS_CARPETAS/carpeta3/the_binding_of_isaac__the_duke_of_flies_by_applesanimatics-d6r52yw.jpg
VARIAS_CARPETAS/carpeta3/vikings-episode-4-trial.jpg
VARIAS_CARPETAS/carpeta4
VARIAS_CARPETAS/carpeta4/.DS_Store
VARIAS_CARPETAS/carpeta4/parda.jpg
VARIAS_CARPETAS/carpeta4/s_033.png
VARIAS_CARPETAS/carpeta4/the_binding_of_isaac__the_duke_of_flies_by_applesanimatics-d6r52yw.jpg
VARIAS_CARPETAS/carpeta4/vikings-episode-4-trial.jpg
VARIAS_CARPETAS/carpeta5
VARIAS_CARPETAS/carpeta5/.DS_Store
VARIAS_CARPETAS/carpeta5/parda.jpg
VARIAS_CARPETAS/carpeta5/s_033.png
VARIAS_CARPETAS/carpeta5/the_binding_of_isaac__the_duke_of_flies_by_applesanimatics-d6r52yw.jpg
VARIAS_CARPETAS/carpeta5/vikings-episode-4-trial.jpg

but doesn't happen with mine:

subdir
subdir/sub
subdir/sub/20130317_001.jpg
subdir/sub/1368555495004.jpg
subdir/sub/1391249528060.jpg
subdir/sub/DSC05207.JPG
subdir/IMG_20130910_071929.jpg
subdir/IMG_20131019_144636.jpg
subdir/IMG_20131019_144640.jpg
subdir/IMG_20131022_202138.jpg
subdir/IMG_20131101_135241.jpg
subdir/folders-only
subdir/folders-only/a
subdir/folders-only/b

@SergioBertolinSG
Copy link
Contributor Author

Maybe the hidden files?

@SergioBertolinSG
Copy link
Contributor Author

It happens also in 10.0.2 so not a regression.

@PVince81
Copy link
Contributor

I tried removing the .DS_Store files from all folders and the upload/overwrite works fine now.
So maybe as you said it might be the hidden files messing up something.

@PVince81
Copy link
Contributor

  • Additional bug (to raise?): the conflict dialog does not show the correct file name on the left, it only shows "carpeta1" for all files that are inside that folder.

@PVince81
Copy link
Contributor

PVince81 commented Sep 13, 2017

  • another bug (to raise, performance): seems the subfolders get a PROPFIND several times during the upload instead of only once. Maybe this.uploader._knownDirs is not working or not matching properly with existing folders

@PVince81
Copy link
Contributor

I have the feeling there's a race condition somewhere in the upload code. Sometimes I receive different errors.

The weird thing is that sometimes the "OC.Upload" object arrives uninitialized in the "finish" callback even though it was initialized before and even run the query. The fact that it's uninitialize/unpopulated causes JS errors or deviations from the expected code path.

Since this is random, I'll try adding a lot of log statements to be able to trace the exact code paths and states.

@PVince81
Copy link
Contributor

I can't seem to reproduce the issue after renaming ".DS_Store" to "DS_Store" (no dot). Weird...

And the errors, when they happen, are random. It fails in different locations upon different trials.

@PVince81
Copy link
Contributor

Okay, seems I found something: it seems that jquery.fileupload (in getAJAXSettings()) is making a copy of the original "data", so the later reference is not the same "data" object any more.

@felixboehm
Copy link
Contributor

We get this fixed for 10.0.4 ?

@PVince81
Copy link
Contributor

Yes, still on my list

@PVince81
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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 done event, the uploads array is already empty as if it was cleared.

@PVince81
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

@SergioBertolinSG please retest with #29393

@lock
Copy link

lock bot commented 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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p2-high Escalation, on top of current planning, release blocker QA:known sev2-high status/STALE Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants