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

Trying to upload to a locked file gives 500 #7638

Closed
SwikritiT opened this issue Nov 1, 2023 · 1 comment · Fixed by #9895
Closed

Trying to upload to a locked file gives 500 #7638

SwikritiT opened this issue Nov 1, 2023 · 1 comment · Fixed by #9895
Labels

Comments

@SwikritiT
Copy link
Contributor

SwikritiT commented Nov 1, 2023

Steps to reproduce

  1. As user einstein create a file i.e locked/textfile.txt
  2. lock the file locked/textfile.txt
curl -ueinstein:relativity -XLOCK "https://localhost:9200/remote.php/webdav/locked/textfile.txt" -H "Content-Type: application/json" -H "timeout: Second-30" -d"<?xml version='1.0' encoding='UTF-8'?><d:lockinfo xmlns:d='DAV:'><d:lockscope><d:exclusive/></d:lockscope></d:lockinfo>" -vk

Note that the behaviour is same for other dav path and spaces

  1. Try to upload to the locked file
curl -ueinstein:relativity -XPUT "https://localhost:9200/remote.php/webdav/locked/textfile.txt" -d"hello world" -vk

Expected behaviour

The request should fail with some 4xx error maybe 423 will be appropriate for this case?

Actual behaviour

The request fails with 500

> PUT /remote.php/webdav/locked/textfile.txt HTTP/1.1
> Host: localhost:9200
> Authorization: Basic ZWluc3RlaW46cmVsYXRpdml0eQ==
> User-Agent: curl/7.81.0
> Accept: */*
> Content-Length: 11
> Content-Type: application/x-www-form-urlencoded
> 
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Access-Control-Allow-Origin: *
< Content-Length: 0
< Content-Security-Policy: default-src 'none';
< Date: Wed, 01 Nov 2023 07:02:06 GMT
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Permitted-Cross-Domain-Policies: none
< X-Request-Id: swikriti-OptiPlex-3070/a25kbD2eD5-003326
< X-Robots-Tag: none
< X-Xss-Protection: 1; mode=block
< 
* Connection #0 to host localhost left intact

Environment ownCloud Infinite Scale

Version: dfc55c3

Server logs

{"level":"error","service":"storage-users","pkg":"rgrpc","traceid":"00000000000000000000000000000000","error":"error: locked by urn:uuid:9727df55-4c96-44a0-8d99-db3d6da37448","status":{"code":15,"message":"error getting upload id: error: locked by urn:uuid:9727df55-4c96-44a0-8d99-db3d6da37448","trace":"00000000000000000000000000000000"},"time":"2023-11-01T12:51:32+05:45","message":"failed to initiate upload"}
{"level":"error","service":"ocdav","name":"com.owncloud.web.ocdav","traceid":"00000000000000000000000000000000","request-id":"swikriti-OptiPlex-3070/a25kbD2eD5-003393","path":"/users/4c510ada-c86b-4815-8820-42cdf82c3d51/locked/textfile.txt","status":{"code":15,"message":"error getting upload id: error: locked by urn:uuid:9727df55-4c96-44a0-8d99-db3d6da37448","trace":"00000000000000000000000000000000"},"code":500,"time":"2023-11-01T12:51:32+05:45","message":"Internal Server Error"}
@SwikritiT SwikritiT transferred this issue from owncloud/web Nov 1, 2023
@phil-davis
Copy link
Contributor

maybe 403 will be appropriate for this case?'

Or 423 https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/423

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.

2 participants