owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.36k stars 179 forks source link

Sending POST request to create TUS upload to a not existing folder responds different of ocis/oc storage #949

Closed individual-it closed 3 months ago

individual-it commented 3 years ago

sending a request like: curl 'https://localhost:9200/remote.php/dav/files/admin/does-not-exist' -H 'Accept: */*' -H 'Tus-Resumable: 1.0.0' -H 'X-Requested-With: XMLHttpRequest' -H 'Upload-Length: 9' -H 'Upload-Metadata: filename YjEudHh0,filetype dGV4dC9wbGFpbg==,size OQ==,mtime MTU5OTAyNDgzNi42MQ==' -H 'Origin: https://localhost:9200' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: https://localhost:9200/' --data-raw '' -uadmin:admin -v -k

results in HTTP 404 when the server is using ocis storage but in HTTP 201 when running owncloud storage

Which one is correct?

individual-it commented 3 years ago

I think the ocis storage reacts correctly, oc storage does seem to receive the file and the fail when trying to move it to the correct folder:


[tusd] 2020/11/26 10:25:56 event="ChunkWriteStart" id="2c5a732c-44b1-4148-874a-1decdc711b29" maxSize="4" offset="0" 
[tusd] 2020/11/26 10:25:56 event="ChunkWriteComplete" id="2c5a732c-44b1-4148-874a-1decdc711b29" bytesWritten="4" 
2020-11-26 10:25:56.549 ERR home/artur/go/pkg/mod/github.com/cs3org/reva@v1.4.1-0.20201125144025-57da0c27434c/pkg/storage/fs/owncloud/upload.go:400 > ocfs: could not rename error="rename /var/tmp/ocis/owncloud/ddc2004c-0977-11eb-9d3f-a793888cd0f8/uploads/2c5a732c-44b1-4148-874a-1decdc711b29 /var/tmp/ocis/owncloud/ddc2004c-0977-11eb-9d3f-a793888cd0f8/files/folder1/filename.txt: no such file or directory" binPath=/var/tmp/ocis/owncloud/ddc2004c-0977-11eb-9d3f-a793888cd0f8/uploads/2c5a732c-44b1-4148-874a-1decdc711b29 info={"ID":"2c5a732c-44b1-4148-874a-1decdc711b29","IsFinal":false,"IsPartial":false,"MetaData":{"dir":"/folder1","filename":"filename.txt"},"Offset":4,"PartialUploads":null,"Size":4,"SizeIsDeferred":false,"Storage":{"BinPath":"/var/tmp/ocis/owncloud/ddc2004c-0977-11eb-9d3f-a793888cd0f8/uploads/2c5a732c-44b1-4148-874a-1decdc711b29","Idp":"https://localhost:9200","InternalDestination":"/var/tmp/ocis/owncloud/ddc2004c-0977-11eb-9d3f-a793888cd0f8/files/folder1/filename.txt","LogLevel":"trace","Type":"OwnCloudStore","UserId":"ddc2004c-0977-11eb-9d3f-a793888cd0f8","UserName":"admin"}} ipath=/var/tmp/ocis/owncloud/ddc2004c-0977-11eb-9d3f-a793888cd0f8/files/folder1/filename.txt pid=23236
[tusd] 2020/11/26 10:25:56 event="ResponseOutgoing" status="404" method="PATCH" path="/2c5a732c-44b1-4148-874a-1decdc711b29" error="upload not found" requestId="" 
kobergj commented 3 months ago

ok. Lets say ocis storage works correctly :smile: Imho fix for owncloud storage is not really needed atm. closing.