Skip to content

PUT overwriting chunk uses wrong code path #32291

Open
@PVince81

Description

@PVince81

Blocker for testing #32282

Steps

  1. check out 10.0.9-resuming-chunks branch (which is based on [stable10] [revived] Retry chunks in web UI on stalled uploads #32170 and adds logging)
  2. replace code in Sabre/Directory.php with the following:
	public function createFileDirectly($name, $data) {
		//$this->fileView->file_put_contents($this->getPath() . '/' .  $name, $data);
		$tgt = $this->fileView->fopen($this->getPath() . '/' .  $name, 'wb');
		sleep(120);
		die('');

		$count = 0;
		while(!feof($data)) {
				sleep(120);
		}
		fclose($data);
		fclose($tgt);

	}


  1. occ config:app:set files upload_stall_timeout --value 5
  2. then upload a 120 mb file in the web UI
  3. observe the data/admin/uploads/*/ folders and see that chunk data is written depite the code not being run

So far my observation is that whenever a chunk is aborted on the JS side, there is suddenly a second request to the same URL, and here somehow it bypasses the code path leading to createFileDirectly but goes to Sabre\File::put instead.

{"reqId":"ee9W6RalKAyug9foZDvf","level":3,"time":"2018-08-09T16:33:55+00:00","remoteAddr":"127.0.0.1","user":"admin","app":"DEBUG","method":"PUT","url":"\/owncloud\/remote.php\/dav\/uploads\/admin\/web-file-upload-646ae38e82a0dbdc5f71465402a96df6-1533832395140\/52428800","message":"createFileDirectly: 52428800"}
{"reqId":"H2vTTPDb1QuZpl6Q0ZMj","level":3,"time":"2018-08-09T16:34:04+00:00","remoteAddr":"127.0.0.1","user":"admin","app":"DEBUG","method":"PUT","url":"\/owncloud\/remote.php\/dav\/uploads\/admin\/web-file-upload-646ae38e82a0dbdc5f71465402a96df6-1533832395140\/52428800","message":"Sabre\\File::put \/web-file-upload-646ae38e82a0dbdc5f71465402a96df6-1533832395140\/52428800"}
{"reqId":"H2vTTPDb1QuZpl6Q0ZMj","level":3,"time":"2018-08-09T16:34:04+00:00","remoteAddr":"127.0.0.1","user":"admin","app":"DEBUG","method":"PUT","url":"\/owncloud\/remote.php\/dav\/uploads\/admin\/web-file-upload-646ae38e82a0dbdc5f71465402a96df6-1533832395140\/52428800","message":"streamCopy "}

@VicDeo @DeepDiver1975

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions