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 unlock a shared file as a share reciever with sharer's lock token gives 500 #7767

Open
SwikritiT opened this issue Nov 21, 2023 · 3 comments
Labels

Comments

@SwikritiT
Copy link
Contributor

SwikritiT commented Nov 21, 2023

Describe the bug

When a user tries to unlock a locked file shared to them using the sharer's lock token the ocis server returns 500

Steps to reproduce

  1. As user einstein create file parent.txt
  2. As user einstein share file parent.txt with user marie
  3. As user einstein lock the file parent.txt
curl -ueinstein:relativity -XLOCK "https://localhost:9200/remote.php/dav/files/einstein/parent.txt" -H "Content-Type: application/json" -d"<?xml version='1.0' encoding='UTF-8'?><d:lockinfo xmlns:d='DAV:'><d:lockscope><d:exclusive/></d:lockscope></d:lockinfo>" -vk  
response

> LOCK /remote.php/dav/files/einstein/parent.txt HTTP/1.1
> Host: localhost:9200
> Authorization: Basic ZWluc3RlaW46cmVsYXRpdml0eQ==
> User-Agent: curl/7.81.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 119
> 
* 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 200 OK
< Access-Control-Allow-Origin: *
< Content-Length: 567
< Content-Security-Policy: default-src 'none';
< Content-Type: application/xml; charset=utf-8
< Date: Tue, 21 Nov 2023 09:06:34 GMT
< Lock-Token: <urn:uuid:a088931e-1ef4-49e3-b56e-720e16807967>
< 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/KuQ45JfH3D-002382
< X-Robots-Tag: none
< X-Xss-Protection: 1; mode=block
< 
<?xml version="1.0" encoding="UTF-8"?>
<d:prop xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:lockdiscovery><d:activelock>
  <d:locktype><d:write/></d:locktype>
  <d:lockscope><d:exclusive/></d:lockscope>
  <d:depth>infinity</d:depth>
  <d:timeout>Infinite</d:timeout>
  <d:locktoken><d:href>urn:uuid:a088931e-1ef4-49e3-b56e-720e16807967</d:href></d:locktoken>
  <d:lockroot><d:href>./parent.txt</d:href></d:lockroot>
  <oc:ownername>Albert Einstein</oc:ownername>
  <oc:locktime>2023-11-21T14:51:34+05:45</oc:locktime>
* Connection #0 to host localhost left intact
</d:activelock></d:lockdiscovery></d:prop>%              

4. As user `marie` try to unlock the file share by `einstein` by using the lock token from `einstein` i.e above lock request's response
curl -XUNLOCK "https://localhost:9200/remote.php/dav/files/marie/Shares/parent.txt" -H "Lock-Token:<lock-token>" -umarie:radioactivity -vk

Expected behavior

The server should throw the appropriate error message and status code maybe 403?.

Actual behavior

The request fails with 500 status code and error message rpc error: code = Unimplemented desc = gateway: error calling Unlock: rpc error: code = Unimplemented desc = method not implemented

response

* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: O=Acme Corp; CN=OCIS
*  start date: Nov 21 08:47:04 2023 GMT
*  expire date: Nov 20 08:47:04 2024 GMT
*  issuer: O=Acme Corp; CN=OCIS
*  SSL certificate verify result: self-signed certificate (18), continuing anyway.
* Server auth using Basic with user 'marie'
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> UNLOCK /remote.php/dav/files/marie/Shares/parent.txt HTTP/1.1
> Host: localhost:9200
> Authorization: Basic bWFyaWU6cmFkaW9hY3Rpdml0eQ==
> User-Agent: curl/7.81.0
> Accept: */*
> Lock-Token: urn:uuid:a088931e-1ef4-49e3-b56e-720e16807967
> 
* 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: 286
< Content-Security-Policy: default-src 'none';
< Content-Type: text/xml; charset=utf-8
< Date: Tue, 21 Nov 2023 09:06:49 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/KuQ45JfH3D-002384
< X-Robots-Tag: none
< X-Xss-Protection: 1; mode=block
< 
<?xml version="1.0" encoding="UTF-8"?>
* Connection #0 to host localhost left intact
<d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns"><s:exception></s:exception><s:message>rpc error: code = Unimplemented desc = gateway: error calling Unlock: rpc error: code = Unimplemented desc = method not implemented</s:message></d:error>% 

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

OCIS_COMMITID=42cdd2c86388a9058e1168128ec49b263dbd2e6f

OCIS started with

PROXY_ENABLE_BASIC_AUTH=true OCIS_INSECURE=true OCIS_ASYNC_UPLOADS=true IDM_CREATE_DEMO_USERS=true OCIS_LOG_LEVEL=error ./bin/ocis server

Server logs

{"level":"error","service":"storage-shares","pkg":"rgrpc","traceid":"00000000000000000000000000000000","user-agent":"curl/7.81.0","from":"tcp://127.0.0.1:53040","uri":"/cs3.storage.provider.v1beta1.ProviderAPI/Unlock","start":"22/Nov/2023:10:41:40 +0545","end":"22/Nov/2023:10:41:40 +0545","time_ns":111467,"code":"Unimplemented","time":"2023-11-22T10:41:40+05:45","message":"rpc error: code = Unimplemented desc = method not implemented"}
{"level":"error","service":"gateway","pkg":"rgrpc","traceid":"00000000000000000000000000000000","user-agent":"curl/7.81.0","from":"tcp://127.0.0.1:57296","uri":"/cs3.gateway.v1beta1.GatewayAPI/Unlock","start":"22/Nov/2023:10:41:40 +0545","end":"22/Nov/2023:10:41:40 +0545","time_ns":1176652,"code":"Unimplemented","time":"2023-11-22T10:41:40+05:45","message":"gateway: error calling Unlock: rpc error: code = Unimplemented desc = method not implemented"}

@SwikritiT SwikritiT changed the title Trying unlock a shared file with sharer's lock token gives 500 Trying to unlock a shared file with sharer's lock token gives 500 Nov 21, 2023
@2403905
Copy link
Contributor

2403905 commented Nov 21, 2023

Can not reproduce. Looks like it comes from the sharesstorageprovider
Could you add the configuration (env)

@SwikritiT
Copy link
Contributor Author

The tests related to this is also failing in the CI https://drone.owncloud.com/owncloud/ocis/29020/23/5
Search for this scenario Scenario Outline: trying to unlock a shared file that has been locked by the file owner

@SwikritiT
Copy link
Contributor Author

Can not reproduce. Looks like it comes from the sharesstorageprovider Could you add the configuration (env)

I've updated the issue with the ocis server logs and the envs

@SwikritiT SwikritiT changed the title Trying to unlock a shared file with sharer's lock token gives 500 Trying to unlock a shared file as a share reciever with sharer's lock token gives 500 Nov 22, 2023
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