owncloud / owncloud/ocis

Trying to unlock a shared file as a share reciever with sharer's lock token gives `500`

Open
#7,767 3 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 2h
Merged PRs (30d)
106

Description

## 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`
```console
curl -ueinstein:relativity -XLOCK "https://localhost:9200/remote.php/dav/files/einstein/parent.txt" -H "Content-Type: application/json" -d"" -vk
```

response

```console
> 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:
< 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
<



infinity
Infinite
urn:uuid:a088931e-1ef4-49e3-b56e-720e16807967
./parent.txt
Albert Einstein
2023-11-21T14:51:34+05:45
* Connection #0 to host localhost left intact
%
```

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

```console
curl -XUNLOCK "https://localhost:9200/remote.php/dav/files/marie/Shares/parent.txt" -H "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

```console
* 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
<

* Connection #0 to host localhost left intact
rpc error: code = Unimplemented desc = gateway: error calling Unlock: rpc error: code = Unimplemented desc = method not implemented%
```


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

```console
OCIS_COMMITID=42cdd2c86388a9058e1168128ec49b263dbd2e6f
```

OCIS started with
```console
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
```console
{"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"}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.