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

[OC storage] file operations not working as share recipient #205

Closed
exalate-issue-sync bot opened this issue Sep 4, 2020 · 35 comments · Fixed by owncloud/ocis#543 or cs3org/reva#1170
Closed
Assignees
Labels
bug Something isn't working Exalated This issue is under sync p3-medium Type:Bug

Comments

@exalate-issue-sync
Copy link

exalate-issue-sync bot commented Sep 4, 2020

Steps to reproduce

  1. Setup ocis from master with OC storage
  2. Login as "einstein"
  3. Create a folder "test"
  4. Share "test" with "Marie"
  5. Login as "Marie"
  6. Go to "shared with me" section
  7. Accept the share
  8. Click on "All files" (don't click the link directly!)
  9. Enter the folder "Shares/test"
  10. Create a directory "abc"

Expected result

Creation works

Actual result

Creation fails with log entries with wrongly concatenated absolute paths (see analysis below)

Additional info

Same issue with upload, download, delete

@exalate-issue-sync exalate-issue-sync bot added bug Something isn't working Exalated This issue is under sync p3-medium labels Sep 4, 2020
@exalate-issue-sync
Copy link
Author

Vincent Petry commented: Reproducible locally.

Upload and download as share recipient is broken.
Upload and download works fine as owner.

2020-09-03T10:02:29+02:00 DBG sending request to internal data server pkg=rhttp service=reva target=http://localhost:9156/data/var/tmp/
reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz traceid=50bffdb406998434d19c600f9d1934a1
2020-09-03T10:02:29+02:00 INF access token is already provided pkg=rhttp service=reva traceid=50bffdb406998434d19c600f9d1934a1
2020-09-03T10:02:29+02:00 DBG http routing: head=data tail=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft
.tar.gz svc=data pkg=rhttp service=reva
[tusd] 2020/09/03 10:02:29 event="RequestIncoming" method="GET" path="/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/tes
t/Minecraft.tar.gz" requestId="" 
2020-09-03T10:02:29+02:00 INF tusd routing: path=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz pk
g=rhttp service=reva traceid=50bffdb406998434d19c600f9d1934a1
2020-09-03T10:02:29+02:00 DBG ocfs: unwrap: internal=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/var/tmp/reva/data/4c
510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/t
est/Minecraft.tar.gz pkg=rhttp service=reva traceid=50bffdb406998434d19c600f9d1934a1
2020-09-03T10:02:29+02:00 ERR datasvc: file not found error="error: not found: /var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/
files/test/Minecraft.tar.gz" pkg=rhttp service=reva traceid=50bffdb406998434d19c600f9d1934a1

Bisecting...

@exalate-issue-sync
Copy link
Author

Vincent Petry commented: also broken in ocis v1.0.0-beta9

so it's not a regression...

@exalate-issue-sync
Copy link
Author

Vincent Petry commented: broken also in beta8, beta7 and beta6 but in a different way.

it feels like it maybe was never working.

@exalate-issue-sync
Copy link
Author

Benedikt Kulmann commented: broken as well in ocis master running with EOS.
Tested with a shared single file instead of a folder. Just heard now that single file shares are not working properly. Testing again with downloading a file from a shared a folder.

@exalate-issue-sync
Copy link
Author

Vincent Petry commented: it seems the problem is specific to OC storage.
upload and download as recipient with EOS works fine.

this is on ocis master (ba3eb488e39b54a45ef40fd9608fb82b2e2b78c6)

@exalate-issue-sync
Copy link
Author

Vincent Petry commented: strange thing that unwrap has concatenated the paths to internal=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz

we observed that kind of behavior before with [~jfd]

@exalate-issue-sync
Copy link
Author

Benedikt Kulmann commented: I can confirm that it works fine with EOS storage.

@exalate-issue-sync
Copy link
Author

Vincent Petry commented: Seems this was already known before: owncloud/ocis-reva#359

@exalate-issue-sync
Copy link
Author

Remote key is https://jira.owncloud.com/browse/OCIS-446

@PVince81 PVince81 self-assigned this Sep 4, 2020
@PVince81 PVince81 changed the title [OC storage] cannot upload/download files as share recipient [OC storage] file operations not working as share recipient Sep 4, 2020
@PVince81
Copy link

PVince81 commented Sep 4, 2020

creating folders also broken.

likely related to that strange issue with ocfs's unwrap:

2020-09-04T11:16:29+02:00 DBG ocfs: unwrap home external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/abc internal=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/abc pkg=rgrpc service=reva traceid=a76c8fad5345fa1913c25f87a586890a trim=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files user=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c

it seems that it's passing in an absolute path to ocfs when the path should be relative

@PVince81
Copy link

PVince81 commented Sep 4, 2020

when creating a directory outside of shares, the "fn" is relative:

ocis.log:2020-09-04T11:27:17+02:00 DBG ocfs: CreateDir fn=/outside pkg=rgrpc service=reva traceid=a0d50d08645e4be64ccb4b0934ee96b2

when creating it inside the shared folder, it becomes absolute:

ocis.log:2020-09-04T11:26:29+02:00 DBG ocfs: CreateDir fn=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/def pkg=rgrpc service=reva traceid=f1cd58a9e93e6fa659081798c344aefe

so the issue is likely not in the owncloud storage itself but could be outside, in the caller.
I wonder if it's just a config issue of some sorts...

@PVince81
Copy link

PVince81 commented Sep 4, 2020

something already wrong on storage provider level:

ocis.log:2020-09-04T11:45:22+02:00 DBG FindProvider by path fn=/home/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/ba123 pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009154":"localhost:9154","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162","e1a73ede-549b-4226-abdf-40e69ca8230d":"localhost:10054"} service=reva traceid=36dbd06849addeb38a27f704eb92db3d

fn should be relative here as well...

@PVince81
Copy link

PVince81 commented Sep 4, 2020

Deletion also not working:

ocis.log:2020-09-04T11:47:47+02:00 INF access token is already provided pkg=rhttp service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG http routing head=remote.php pkg=rhttp service=reva tail=/webdav/Shares/test/Minecraft.tar.gz traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG skipping auth method=/cs3.gateway.v1beta1.GatewayAPI/Delete pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG gateway: split: path:/home/Shares/test/Minecraft.tar.gz parts:[home Shares test Minecraft.tar.gz] shareFolder:Shares pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG gateway: split: path:/home/Shares/test/Minecraft.tar.gz parts:[home Shares test Minecraft.tar.gz] shareFolder:Shares pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG gateway: split: path:/home/Shares/test/Minecraft.tar.gz parts:[home Shares test Minecraft.tar.gz] shareFolder:Shares pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG path:/home/Shares/test/Minecraft.tar.gz sharename:/home/Shares/test sharechild: /Minecraft.tar.gz pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG FindProvider by path fn=/home/Shares/test pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009154":"localhost:9154","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162","e1a73ede-549b-4226-abdf-40e69ca8230d":"localhost:10054"} service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 INF unary code=OK end="04/Sep/2020:11:47:47 +0200" from=tcp://127.0.0.1:60436 pkg=rgrpc service=reva start="04/Sep/2020:11:47:47 +0200" time_ns=946839 traceid=115eb089f99f916c7e65f54011f9e8b7 uri=/cs3.storage.registry.v1beta1.RegistryAPI/GetStorageProvider user-agent=grpc-go/1.26.0
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: wrap fn=/Shares/test internal=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/Shares/test pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: unwrap EnableHome=true pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: unwrap home external=/Shares/test internal=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/Shares/test pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7 trim=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files user=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: unwrap: internal=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/Shares/test external=/Shares/test pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: unwrapShadow: internal=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/shadow_files/Shares/test external=/Shares/test pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 INF unary code=OK end="04/Sep/2020:11:47:47 +0200" from=tcp://127.0.0.1:48492 pkg=rgrpc service=reva start="04/Sep/2020:11:47:47 +0200" time_ns=4299368 traceid=115eb089f99f916c7e65f54011f9e8b7 uri=/cs3.storage.provider.v1beta1.ProviderAPI/Stat user-agent=grpc-go/1.26.0
ocis.log:2020-09-04T11:47:47+02:00 DBG FindProvider by path fn= pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009154":"localhost:9154","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162","e1a73ede-549b-4226-abdf-40e69ca8230d":"localhost:10054"} service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG FindProvider by id id="storage_id:\"1284d238-aa92-42ce-bdc4-0b0000009154\" opaque_id:\"9f154cee-381a-44f2-8ef3-35a0f48fafc2\" " pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009154":"localhost:9154","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162","e1a73ede-549b-4226-abdf-40e69ca8230d":"localhost:10054"} service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG FindProvider result address=localhost:9154 pkg=rgrpc providerId=1284d238-aa92-42ce-bdc4-0b0000009154 service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 INF unary code=OK end="04/Sep/2020:11:47:47 +0200" from=tcp://127.0.0.1:60436 pkg=rgrpc service=reva start="04/Sep/2020:11:47:47 +0200" time_ns=949200 traceid=115eb089f99f916c7e65f54011f9e8b7 uri=/cs3.storage.registry.v1beta1.RegistryAPI/GetStorageProvider user-agent=grpc-go/1.26.0
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: unwrap EnableHome=true pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: unwrap home external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test internal=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7 trim=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files user=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: unwrap: internal=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: unwrap EnableHome=true pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: unwrap home external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test internal=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7 trim=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files user=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c
ocis.log:2020-09-04T11:47:47+02:00 DBG ocfs: unwrap: internal=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG skipping auth method=/cs3.identity.user.v1beta1.UserAPI/GetUser pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:48+02:00 DBG entries entries=[{"Attributes":[{"ByteValues":["ZWluc3RlaW4="],"Name":"cn","Values":["einstein"]},{"ByteValues":["NGM1MTBhZGEtYzg2Yi00ODE1LTg4MjAtNDJjZGY4MmMzZDUx"],"Name":"ownCloudUUID","Values":["4c510ada-c86b-4815-8820-42cdf82c3d51"]},{"ByteValues":["QWxiZXJ0IEVpbnN0ZWlu"],"Name":"displayName","Values":["Albert Einstein"]},{"ByteValues":["ZWluc3RlaW5AZXhhbXBsZS5vcmc="],"Name":"mail","Values":["einstein@example.org"]},{"ByteValues":["MjAwMDA="],"Name":"uidnumber","Values":["20000"]},{"ByteValues":["MzAwMDA="],"Name":"gidnumber","Values":["30000"]}],"DN":"cn=einstein,ou=users,dc=example,dc=org"}] pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:48+02:00 INF unary code=OK end="04/Sep/2020:11:47:48 +0200" from=tcp://127.0.0.1:46446 pkg=rgrpc service=reva start="04/Sep/2020:11:47:47 +0200" time_ns=336682135 traceid=115eb089f99f916c7e65f54011f9e8b7 uri=/cs3.identity.user.v1beta1.UserAPI/GetUser user-agent=grpc-go/1.26.0
ocis.log:2020-09-04T11:47:48+02:00 INF unary code=OK end="04/Sep/2020:11:47:48 +0200" from=tcp://127.0.0.1:48492 pkg=rgrpc service=reva start="04/Sep/2020:11:47:47 +0200" time_ns=343292026 traceid=115eb089f99f916c7e65f54011f9e8b7 uri=/cs3.storage.provider.v1beta1.ProviderAPI/Stat user-agent=grpc-go/1.26.0
ocis.log:2020-09-04T11:47:48+02:00 DBG FindProvider by path fn=/home/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009154":"localhost:9154","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162","e1a73ede-549b-4226-abdf-40e69ca8230d":"localhost:10054"} service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:48+02:00 INF unary code=OK end="04/Sep/2020:11:47:48 +0200" from=tcp://127.0.0.1:60436 pkg=rgrpc service=reva start="04/Sep/2020:11:47:48 +0200" time_ns=569977 traceid=115eb089f99f916c7e65f54011f9e8b7 uri=/cs3.storage.registry.v1beta1.RegistryAPI/GetStorageProvider user-agent=grpc-go/1.26.0
ocis.log:2020-09-04T11:47:48+02:00 DBG ocfs: wrap fn=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz internal=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:48+02:00 DBG ocfs: unwrap EnableHome=true pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:48+02:00 DBG ocfs: unwrap home external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz internal=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7 trim=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files user=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c
ocis.log:2020-09-04T11:47:48+02:00 DBG ocfs: unwrap: internal=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/Minecraft.tar.gz pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:48+02:00 WRN home/vincent/Private/Work/workspace/reva/internal/grpc/services/storageprovider/storageprovider.go:408 > file not found pkg=rgrpc service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:48+02:00 INF unary code=OK end="04/Sep/2020:11:47:48 +0200" from=tcp://127.0.0.1:48492 pkg=rgrpc service=reva start="04/Sep/2020:11:47:48 +0200" time_ns=1690145 traceid=115eb089f99f916c7e65f54011f9e8b7 uri=/cs3.storage.provider.v1beta1.ProviderAPI/Delete user-agent=grpc-go/1.26.0
ocis.log:2020-09-04T11:47:48+02:00 INF unary code=OK end="04/Sep/2020:11:47:48 +0200" from=tcp://127.0.0.1:60466 pkg=rgrpc service=reva start="04/Sep/2020:11:47:47 +0200" time_ns=361022107 traceid=115eb089f99f916c7e65f54011f9e8b7 uri=/cs3.gateway.v1beta1.GatewayAPI/Delete user-agent=grpc-go/1.26.0
ocis.log:2020-09-04T11:47:48+02:00 WRN resource not found code="\x06" pkg=rhttp service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:48+02:00 WRN http end="04/Sep/2020:11:47:48 +0200" host=127.0.0.1 method=DELETE pkg=rhttp proto=HTTP/1.1 service=reva size=0 start="04/Sep/2020:11:47:47 +0200" status=404 time_ns=363702257 traceid=115eb089f99f916c7e65f54011f9e8b7 uri=/remote.php/webdav/Shares/test/Minecraft.tar.gz url=/remote.php/webdav/Shares/test/Minecraft.tar.gz

interesting are these lines in the middle:

ocis.log:2020-09-04T11:47:47+02:00 DBG FindProvider by path fn= pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009154":"localhost:9154","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162","e1a73ede-549b-4226-abdf-40e69ca8230d":"localhost:10054"} service=reva traceid=115eb089f99f916c7e65f54011f9e8b7
ocis.log:2020-09-04T11:47:47+02:00 DBG FindProvider by id id="storage_id:\"1284d238-aa92-42ce-bdc4-0b0000009154\" opaque_id:\"9f154cee-381a-44f2-8ef3-35a0f48fafc2\" " pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009154":"localhost:9154","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162","e1a73ede-549b-4226-abdf-40e69ca8230d":"localhost:10054"} service=reva traceid=115eb089f99f916c7e65f54011f9e8b7

resolving storage by id which will pick 9154, which is the "storage home".

somehow this reminds me of the problem we had with EOS: #129

@butonic I think we'll need the same kind of config gymnastics with the storage id cheat also for OC storage, and later for OCIS storage...

@PVince81
Copy link

PVince81 commented Sep 4, 2020

I had a look at the EOS way. The difference is that EOS has both "eos" and "eoshome" drivers where "eos" is the root folder and "eoshome" points to user homes.

However for the OC storage driver (and also later OCIS storage in owncloud/ocis-reva#461), we only have the home one (because we need to set to enable_home=true for everything to work correctly).

So either we need to create a second driver "ochome" like "eoshome" and use the same mount id overlapping tricks like in #129.

Or change the implementation to be always able to work with the root storage. It feels like this would be more work.

@PVince81
Copy link

PVince81 commented Sep 4, 2020

Just tried a very naive attempt, starting ocis with REVA_STORAGE_HOME_MOUNT_ID=1284d238-aa92-42ce-bdc4-0b0000009162 which would set the mount id used by the share to the one of "/oc" instead of "/home".

but I only managed to make FindProvider switch to the other one, but the unwrap is still receiving the full path as before:

2020-09-04T14:19:22+02:00 DBG FindProvider by path fn= pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162"} service=reva traceid=cc817bb483cfb854ce65014468f994e9
2020-09-04T14:19:22+02:00 DBG FindProvider by id id="storage_id:\"1284d238-aa92-42ce-bdc4-0b0000009162\" opaque_id:\"1f90d6e8-be02-48be-959b-4f2e812c6e3d\" " pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162"} service=reva traceid=cc817bb483cfb854ce65014468f994e9
2020-09-04T14:19:22+02:00 DBG FindProvider result address=localhost:9162 pkg=rgrpc providerId=1284d238-aa92-42ce-bdc4-0b0000009162 service=reva traceid=cc817bb483cfb854ce65014468f994e9
2020-09-04T14:19:22+02:00 INF unary code=OK end="04/Sep/2020:14:19:22 +0200" from=tcp://127.0.0.1:49168 pkg=rgrpc service=reva start="04/Sep/2020:14:19:22 +0200" time_ns=957354 traceid=cc817bb483cfb854ce65014468f994e9 uri=/cs3.storage.registry.v1beta1.RegistryAPI/GetStorageProvider user-agent=grpc-go/1.26.0
2020-09-04T14:19:22+02:00 DBG ocfs: unwrap EnableHome=true pkg=rgrpc service=reva traceid=cc817bb483cfb854ce65014468f994e9
2020-09-04T14:19:22+02:00 DBG ocfs: unwrap home external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test internal=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test pkg=rgrpc service=reva traceid=cc817bb483cfb854ce65014468f994e9 trim=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files user=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c

Maybe the problem is a different one...

@PVince81
Copy link

PVince81 commented Sep 7, 2020

seems it's still aiming to the wrong storage despite the override above:

ocis.log:2020-09-07T14:11:53+02:00 DBG storageprovider: CreateContainer p=/home/Shares/test/abc pkg=rgrpc service=reva traceid=f58d2f09e73b9941dc62681c351605ba

From my understanding the path should become "p=/oc/4c510ada-c86b-4815-8820-42cdf82c3d51/test/abc".

And I found this FindProvider that just appends the absolute path after "/oc":

ocis.log:2020-09-07T14:11:54+02:00 DBG FindProvider by path fn=/oc/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/abc pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162"} service=reva traceid=f58d2f09e73b9941dc62681c351605ba

@PVince81
Copy link

PVince81 commented Sep 7, 2020

I do find it strange that doing a PROPFIND there (in "Shares/test/sub") works fine, it seems ListContainer is not doing the same kind of things that CreateContainer does.

@PVince81
Copy link

PVince81 commented Sep 7, 2020

I think I've got something, still with the above env change:

ocis.log:2020-09-07T14:38:01+02:00 DBG ocfs: unwrap home external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test internal=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test pkg=rgrpc service=reva traceid=4516a300abe1040eeb8c1dcd03738012 trim=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files user=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c

I see that the prefix from which to trim the home is based on the current user but should actually be based on the share owner.
This is why the trimming is not doing anything...

From what I see the code would always be working with the currently logged in user, so unwrap() would not be able to work with a different user.

@PVince81
Copy link

PVince81 commented Sep 7, 2020

I tried to compare with the EOS wrap/unwrap code but it isn't that different, they both rely on the user in the context. But the EOS approach works (with its special config).

I'm not clear yet where in the code the share would be resolved from Marie's "Shares/test/abc" to the Einstein's "/test/abc".

@PVince81
Copy link

PVince81 commented Sep 7, 2020

I've switched back to the original scenario, no overrides. Trying to look into why listing folders work but not other operations.

This is some of the flow (with local log debug statements):

2020-09-07T15:24:48+02:00 DBG ocfs: ListFolder np=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/var/tmp/reva/data/4c510
ada-c86b-4815-8820-42cdf82c3d51/files/test/sub pkg=rgrpc ref="path:\"/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test
/sub\" " service=reva traceid=4dd08ee711863f51a36a0e0e080a0301
2020-09-07T15:24:48+02:00 DBG ocfs: unwrap EnableHome=true pkg=rgrpc service=reva traceid=4dd08ee711863f51a36a0e0e080a0301
2020-09-07T15:24:48+02:00 DBG ocfs: unwrap home external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub interna
l=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub p
kg=rgrpc service=reva traceid=4dd08ee711863f51a36a0e0e080a0301 trim=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files user=
f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c
2020-09-07T15:24:48+02:00 DBG ocfs: unwrap: internal=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/var/tmp/reva/data/4c
510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub pkg=r
grpc service=reva traceid=4dd08ee711863f51a36a0e0e080a0301
2020-09-07T15:24:48+02:00 DBG ocfs: ListFolder: home enabled p=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub p
kg=rgrpc service=reva traceid=4dd08ee711863f51a36a0e0e080a0301
2020-09-07T15:24:48+02:00 DBG ocfs: listWithHome p=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub pkg=rgrpc service=reva traceid=4dd08ee711863f51a36a0e0e080a0301
2020-09-07T15:24:48+02:00 DBG listWithHome: listing nominal home pkg=rgrpc service=reva traceid=4dd08ee711863f51a36a0e0e080a0301
2020-09-07T15:24:48+02:00 DBG ocfs: listWithNominalHome fn=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub p=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub pkg=rgrpc service=reva traceid=4dd08ee711863f51a36a0e0e080a0301
2020-09-07T15:24:48+02:00 DBG ocfs: unwrap EnableHome=true pkg=rgrpc service=reva traceid=4dd08ee711863f51a36a0e0e080a0301
2020-09-07T15:24:48+02:00 DBG ocfs: unwrap home external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub/md5.txt internal=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub/md5.txt pkg=rgrpc service=reva traceid=4dd08ee711863f51a36a0e0e080a0301 trim=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files user=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c
2020-09-07T15:24:48+02:00 DBG ocfs: unwrap: internal=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub/md5.txt external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub/md5.txt pkg=rgrpc service=reva traceid=4dd08ee711863f51a36a0e0e080a0301

from what I see the reference that is passed to ListFolder is already pointing at the correct folder from the share owner (einstein), so the resolve() method just uses that.

For CreateDir there is no reference passed in, only a string...

@PVince81
Copy link

PVince81 commented Sep 7, 2020

so it seems that ListContainer in the storage provider is already called with the resolved reference:

2020-09-07T15:37:46+02:00 DBG storageprovider: ListContainer after unwrap newRef="path:\"/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub\" " pkg=rgrpc ref="path:\"/home/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub\" " service=reva traceid=9f4255d6731178e2099ce9fa86d2aab5

and it does so for CreateContainer as well!

2020-09-07T15:40:06+02:00 DBG storageprovider: CreateContainer after unwrap newRef="path:\"/var/tmp/reva/data/4c510ada-c86b-4815-8820-4
2cdf82c3d51/files/test/sub/abc\" " pkg=rgrpc ref="path:\"/home/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub/ab
c\" " service=reva traceid=149eba15e6fbf1135a4e86860525b3c4
2020-09-07T15:40:06+02:00 DBG ocfs: CreateDir fn=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub/abc pkg=rgrpc s
ervice=reva traceid=149eba15e6fbf1135a4e86860525b3c4
2020-09-07T15:40:06+02:00 DBG ocfs: wrap begin EnableHome=true internal= pkg=rgrpc service=reva traceid=149eba15e6fbf1135a4e86860525b3c
4
2020-09-07T15:40:06+02:00 DBG ocfs: wrap end fn=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub/abc internal=/va
r/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub/abc pk
g=rgrpc service=reva traceid=149eba15e6fbf1135a4e86860525b3c4

even CreateDir receives the correct path.

but somehow it seems the code insists on still trying to wrap it, while it doesn't wrap it with ListFolder.

@PVince81
Copy link

PVince81 commented Sep 7, 2020

... and, got it: https://github.com/cs3org/reva/blob/master/pkg/storage/fs/owncloud/owncloud.go#L1582

the only reason the PROPFIND code path works if before of the above referenced line: it checks if the path is an absolute one and then does some special handling that skips the wrap call.

we could in theory add this logic elsewhere.

BUT: it feels wrong to have a difference between relative and absolute paths there

@butonic

@PVince81
Copy link

PVince81 commented Sep 7, 2020

it feel redundant that there is some share splitting / resolving logic in the storage provider but also some similar logic in the ownCloud storage implementation, and potentially all of them.

@PVince81
Copy link

PVince81 commented Sep 7, 2020

furthermore, having the complete absolute path visible here feels like a security issue: if someone would be able to modify that path they could potentially access any folder on the storage, not only the actual one (for example access "/var/log" instead of just "/var/tmp/reva/..."

so the proper solution would likely involve having the root storage vs home storage, at least in a way like it works with EOS.
but still, the overlapping of configs feels wrong as well

@PVince81
Copy link

PVince81 commented Sep 7, 2020

next up: checking how it's done for EOS storage

@PVince81
Copy link

PVince81 commented Sep 7, 2020

as far as I can see, with EOS, only the relative path is given:

ocis          | 2020-09-07T14:46:42Z DBG shared child: /home/Shares/test/sub/eosabc pkg=rgrpc service=reva traceid=4042a9caedb17d1e2699
9efcf01b0bad
ocis          | 2020-09-07T14:46:42Z DBG storageprovider: stat pkg=rgrpc req={"ref":{"Spec":{"Path":"/home/Shares/test"}}} service=reva
 traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:42Z DBG FindProvider by path fn=/home/Shares/test pkg=rgrpc rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054","1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009154":"localhost:9154","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162"} service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:42Z INF unary code=OK end="07/Sep/2020:14:46:42 +0000" from=tcp://127.0.0.1:34506 pkg=rgrpc service=reva start="07/Sep/2020:14:46:42 +0000" time_ns=257664 traceid=4042a9caedb17d1e26999efcf01b0bad uri=/cs3.storage.registry.v1beta1.RegistryAPI/GetStorageProvider user-agent=grpc-go/1.26.0
ocis          | 2020-09-07T14:46:42Z DBG storageprovider: unwrap pkg=rgrpc ref="path:\"/home/Shares/test\" " service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:42Z DBG storageprovider: unwrap: after trimMountPrefix fn=/home/Shares/test fsfn=/Shares/test mountPrefix=/home pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:42Z INF eos: get md for ref:path:"/Shares/test"  pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:42Z INF eos cmd args="[/usr/bin/eos -r 20001 30000 file info /eos/dockertest/reva/users/.shadow/f/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/Shares/test -m --comment 4042a9caedb17d1e26999efcf01b0bad]" env=[EOS_MGM_URL=root://mgm-master.testnet:1094] err= exit=0 pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:42Z DBG eos: unwrapInternal layout=f/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c np=/eos/dockertest/reva/users/.shadow/f/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/Shares/test ns=/eos/dockertest/reva/users/.shadow pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:42Z DBG eos: unwrapInternal: trim=/eos/dockertest/reva/users/.shadow/f/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c external=/Shares/test ns=/eos/dockertest/reva/users/.shadow np=/eos/dockertest/reva/users/.shadow/f/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/Shares/test pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad

...

ocis          | 2020-09-07T14:46:43Z DBG storageprovider: CreateContainer: before createContainer pkg=rgrpc service=reva target=/eos/4/
4c510ada-c86b-4815-8820-42cdf82c3d51/test/sub/eosabc traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z DBG FindProvider by path fn=/eos/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test/sub/eosabc pkg=rgrpc 
rules={"":"","/":"localhost:9152","/eos":"localhost:9158","/home":"localhost:9154","/oc":"localhost:9162","/public/":"localhost:10054",
"1284d238-aa92-42ce-bdc4-0b0000009152":"localhost:9152","1284d238-aa92-42ce-bdc4-0b0000009154":"localhost:9154","1284d238-aa92-42ce-bdc4-0b0000009158":"localhost:9158","1284d238-aa92-42ce-bdc4-0b0000009162":"localhost:9162"} service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z INF unary code=OK end="07/Sep/2020:14:46:43 +0000" from=tcp://127.0.0.1:34506 pkg=rgrpc service=reva start="07/Sep/2020:14:46:43 +0000" time_ns=369732 traceid=4042a9caedb17d1e26999efcf01b0bad uri=/cs3.storage.registry.v1beta1.RegistryAPI/GetStorageProvider user-agent=grpc-go/1.26.0
ocis          | 2020-09-07T14:46:43Z DBG storageprovider: CreateContainer: before final c.CreateContainer c={} pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z DBG storageprovider: unwrap pkg=rgrpc ref="path:\"/eos/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test/sub/eosabc\" " service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z DBG storageprovider: unwrap: after trimMountPrefix fn=/eos/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test/sub/eosabc fsfn=/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test/sub/eosabc mountPrefix=/eos pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z DBG storageprovider: CreateContainer after unwrap newRef="path:\"/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test/sub/eosabc\" " pkg=rgrpc ref="path:\"/eos/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test/sub/eosabc\" " service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z INF eos: createdir: path=/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test/sub/eosabc pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad

@PVince81
Copy link

PVince81 commented Sep 7, 2020

and here I see a difference happening how the storage is resolving the opaque id:

EOS:

ocis          | 2020-09-07T14:46:43Z DBG FindProvider result address=localhost:9158 pkg=rgrpc providerId=1284d238-aa92-42ce-bdc4-0b0000009158 service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z INF unary code=OK end="07/Sep/2020:14:46:43 +0000" from=tcp://127.0.0.1:34506 pkg=rgrpc service=reva start="07/Sep/2020:14:46:43 +0000" time_ns=450293 traceid=4042a9caedb17d1e26999efcf01b0bad uri=/cs3.storage.registry.v1beta1.RegistryAPI/GetStorageProvider user-agent=grpc-go/1.26.0
ocis          | 2020-09-07T14:46:43Z DBG storageprovider: unwrap pkg=rgrpc ref="id:<storage_id:\"1284d238-aa92-42ce-bdc4-0b0000009158\" opaque_id:\"20\" > " service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z INF eos: get md for ref:id:<opaque_id:"20" >  pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z INF eos cmd args="[/usr/bin/eos -r 20001 30000 file info inode:20 -m --comment 4042a9caedb17d1e26999efcf01b0bad]" env=[EOS_MGM_URL=root://mgm-master.testnet:1094] err= exit=0 pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z DBG eos: unwrapInternal layout= np=/eos/dockertest/reva/users/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test ns=/eos/dockertest/reva/users pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z DBG eos: unwrapInternal: trim=/eos/dockertest/reva/users external=/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test ns=/eos/dockertest/reva/users np=/eos/dockertest/reva/users/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad
ocis          | 2020-09-07T14:46:43Z DBG eos: unwrap: internal=/eos/dockertest/reva/users/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test external=/4/4c510ada-c86b-4815-8820-42cdf82c3d51/test pkg=rgrpc service=reva traceid=4042a9caedb17d1e26999efcf01b0bad

=> resolution happens on the root and so we find the correct user and path relative to the storage

ownCloud storage:

2020-09-07T15:40:06+02:00 DBG FindProvider result address=localhost:9154 pkg=rgrpc providerId=1284d238-aa92-42ce-bdc4-0b0000009154 service=reva traceid=149eba15e6fbf1135a4e86860525b3c4
2020-09-07T15:40:06+02:00 INF unary code=OK end="07/Sep/2020:15:40:06 +0200" from=tcp://127.0.0.1:43340 pkg=rgrpc service=reva start="07/Sep/2020:15:40:06 +0200" time_ns=772688 traceid=149eba15e6fbf1135a4e86860525b3c4 uri=/cs3.storage.registry.v1beta1.RegistryAPI/GetStorageProvider user-agent=grpc-go/1.26.0
2020-09-07T15:40:06+02:00 DBG storageprovider: unwrap pkg=rgrpc ref="id:<storage_id:\"1284d238-aa92-42ce-bdc4-0b0000009154\" opaque_id:\"1f3e92d2-ee7d-41d9-a258-763df9a96d84\" > " service=reva traceid=149eba15e6fbf1135a4e86860525b3c4
2020-09-07T15:40:06+02:00 DBG ocfs: resolve pkg=rgrpc ref="id:<opaque_id:\"1f3e92d2-ee7d-41d9-a258-763df9a96d84\" > " service=reva traceid=149eba15e6fbf1135a4e86860525b3c4
2020-09-07T15:40:06+02:00 DBG ocfs: unwrap EnableHome=true pkg=rgrpc service=reva traceid=149eba15e6fbf1135a4e86860525b3c4
2020-09-07T15:40:06+02:00 DBG ocfs: unwrap home external=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test internal=/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test pkg=rgrpc service=reva traceid=149eba15e6fbf1135a4e86860525b3c4 trim=/var/tmp/reva/data/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/files user=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c

=> the resolve call is using getPath which itself reads from redis

when looking at redis, I found absolute paths:

17) "8a087f5b-5964-4204-b406-0ceaad23f047"
127.0.0.1:6379> get 8a087f5b-5964-4204-b406-0ceaad23f047
"/var/tmp/reva/data/4c510ada-c86b-4815-8820-42cdf82c3d51/files/test/sub/md5.txt"

so perhaps here the solution is to make the paths stored in redis relative to the storage...

@butonic
Copy link
Member

butonic commented Sep 7, 2020

could the getOwner implementation be at fault? https://github.com/cs3org/reva/blob/master/pkg/storage/fs/owncloud/owncloud.go#L502

it always takes the owner from the path ... 🤔

@PVince81
Copy link

PVince81 commented Sep 7, 2020

from what I see now we'd trim the path prefix anyway, the problem is that the path prefix is using Marie's user id (currently logged in user) but the input path is the one from Einstein, so it cannot be trimmed. Back to square one.

we should look together into aligning the OC storage config to the one we made for EOS @butonic

@PVince81
Copy link

PVince81 commented Sep 8, 2020

I've pushed my branch where I added a lot more logging which can be seen above: cs3org/reva#1147

@phil-davis
Copy link

phil-davis commented Sep 8, 2020

The comment from here has been put in separate issue #208 (and also see #207 )

@PVince81
Copy link

PVince81 commented Sep 8, 2020

@phil-davis what you see looks like a different issue. I grepped my logs and didn't find any issues related to accounts.
Please raise separately to prevent more confusion during analysis of an already complicated issue (which is here about invalid path concatenation)

@PVince81
Copy link

PVince81 commented Sep 8, 2020

fix is here, some config changes: owncloud/ocis-reva#461

@exalate-issue-sync
Copy link
Author

Vincent Petry commented: Fix was merged into ocis with owncloud/ocis-reva#466

Needs verification

@exalate-issue-sync
Copy link
Author

Vincent Petry commented: Tested on ocis.owncloud.works, works fine 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Exalated This issue is under sync p3-medium Type:Bug
Projects
None yet
3 participants