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 with the same mtime and filename causes "internal server errors" #10496

Open
rhafer opened this issue Nov 6, 2024 · 0 comments
Open
Labels

Comments

@rhafer
Copy link
Contributor

rhafer commented Nov 6, 2024

When uploading a file with the same mtime and name but different contents multiple times, I get "500 Internal Server Error" for all uploads after the 2nd upload.

Take e.g. the these three uploads. Each uploading to the same filename using the same mtime in the the Upload-Metadata, but each time a different content:

curl 'https://localhost:9200/remote.php/dav/spaces/fa7e8b99-933b-4b0d-bb68-d6fb96ef6a82$34fbbd0c-16ef-4ac4-956c-1c5df6645286'   -H 'Content-Type: application/offset+octet-stream'   -H 'Tus-Resumable: 1.0.0'   -H 'Upload-Length: 4'   -H 'Upload-Metadata: mtime MTczMDE2MDAwMA==,filename L3Rlc3Qx'   -d'test'   -uadmin:admin -vk
curl 'https://localhost:9200/remote.php/dav/spaces/fa7e8b99-933b-4b0d-bb68-d6fb96ef6a82$34fbbd0c-16ef-4ac4-956c-1c5df6645286'   -H 'Content-Type: application/offset+octet-stream'   -H 'Tus-Resumable: 1.0.0'   -H 'Upload-Length: 4'   -H 'Upload-Metadata: mtime MTczMDE2MDAwMA==,filename L3Rlc3Qx'   -d'tast'   -uadmin:admin -vk
curl 'https://localhost:9200/remote.php/dav/spaces/fa7e8b99-933b-4b0d-bb68-d6fb96ef6a82$34fbbd0c-16ef-4ac4-956c-1c5df6645286'   -H 'Content-Type: application/offset+octet-stream'   -H 'Tus-Resumable: 1.0.0'   -H 'Upload-Length: 4'   -H 'Upload-Metadata: mtime MTczMDE2MDAwMA==,filename L3Rlc3Qx'   -d'tost'   -uadmin:admin -vk

The first two requests work fine (the 2nd one creates a new revision of the file). The 3rd one however causes a 500
reply:

* upload completely sent off: 4 bytes
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
< HTTP/1.1 500 Internal Server Error
< Access-Control-Allow-Headers: Tus-Resumable, Upload-Length, Upload-Metadata, If-Match
< Access-Control-Expose-Headers: Tus-Resumable, Upload-Offset, Location
< Content-Length: 0
< Content-Security-Policy: child-src 'self'; connect-src 'self' blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; default-src 'none'; font-src 'self'; frame-ancestors 'self'; frame-src 'self' blob: https://embed.diagrams.net/; img-src 'self' data: blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; manifest-src 'self'; media-src 'self'; object-src 'self' blob:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'
< Date: Wed, 06 Nov 2024 15:23:23 GMT
< Location: https://localhost:9200/data/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNzMwOTkzMDAzLCJpYXQiOjE3MzA5MDY2MDMsInRhcmdldCI6Imh0dHA6Ly9sb2NhbGhvc3Q6OTE1OC9kYXRhL3R1cy8wNWQyYTkzZC1mYjI0LTQyMDAtOTVlOC0zY2ZjOGQ3NzQwYWUifQ.LAQTnICsTdNOWYzk5Qp6ms2mkGckBmtxu5IqK48S4XA
< Referrer-Policy: strict-origin-when-cross-origin
< Strict-Transport-Security: max-age=315360000; preload
< Tus-Extension: creation,creation-with-upload,checksum,expiration
< Tus-Resumable: 1.0.0
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< X-Permitted-Cross-Domain-Policies: none
< X-Request-Id: 58004e224a1a/p6IS9fNsSR-000089
< X-Robots-Tag: none
< X-Xss-Protection: 1; mode=block
< 

Originally posted by @rhafer in #9498 (comment)

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

No branches or pull requests

2 participants