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

Uploading a 0kb file to a secret file drop results in an error however the file appears in the folder multiple times. #10469

Closed
nicholas-wilson-au opened this issue Oct 30, 2024 · 4 comments · Fixed by #10500
Assignees
Labels

Comments

@nicholas-wilson-au
Copy link

Describe the bug

Uploading a 0kb file to a secret file drop results in an error however the file appears in the folder multiple times.

Steps to reproduce

  1. Create 0kb file
  2. Create space and set up a public link as a secret file drop
  3. Try to upload the file to the secret file drop. Error is seen.
  4. Look in the space and check for file. Multiple copies are there.

Expected behavior

A successful upload of a single file or an error saying the file is empty.

Actual behavior

An error is shown saying upload failed but the upload was successful.

Setup

https://ocis.ocis-keycloak.rolling.owncloud.works/

@AlexAndBear AlexAndBear added the Priority:p3-medium Normal priority label Oct 30, 2024
@JammingBen JammingBen self-assigned this Nov 4, 2024
@JammingBen
Copy link
Contributor

I'm moving this to the ocis repo because I think Web is handling things correctly. When uploading a 0 byte file, the server is missing the Location header in the response.

In a regular context Uppy will retry the exact same request again. The server includes the Location header the second time. In a public link context with only upload permissions (= file drop) however, the server never responds with a location header.

@JammingBen JammingBen transferred this issue from owncloud/web Nov 5, 2024
@JammingBen JammingBen removed their assignment Nov 5, 2024
@2403905
Copy link
Contributor

2403905 commented Nov 5, 2024

@JammingBen How the Web uses the location in this case? The zero-byte file is simply created, it is not going to the tus.

https://github.com/cs3org/reva/blob/b7d7c42e082a5e7784e2545abf768bb0de0b103e/internal/http/services/owncloud/ocdav/tus.go#L190

@2403905 2403905 self-assigned this Nov 6, 2024
@JammingBen
Copy link
Contributor

The underlying lib we use (Uppy) does something with this header, I can't say what exactly. I'd need to check the vendor code.

But why is oCIS sending a Location header on the second try then? Isn't it possible to always send it?

@2403905 2403905 moved this from Qualification to In progress in Infinite Scale Team Board Nov 6, 2024
@JammingBen
Copy link
Contributor

I did some further debugging. As mentioned above, the issue is that the server doesn't send a Location header in the response because zero byte files are simply being touched without tus being involved.

I tried to handle this exception in Web but it's not that easy. Web is assuming that all file uploads are being handled via tus (when enabled) and therefore expects the server to follow the tus protocol under any circumstance. If this isn't the case, it might fail. IMO it's up to the server to provide a clean API here.

cc @2403905 @butonic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants