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

COPY a folder to received share file/folder seems to work but no change in shares - lost share mountpoint in me/drives #6999

Open
amrita-shrestha opened this issue Aug 9, 2023 · 9 comments · May be fixed by #9714
Assignees
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug

Comments

@amrita-shrestha
Copy link
Contributor

amrita-shrestha commented Aug 9, 2023

Describe the bug

While trying to COPY a personal space FOLDER to (not inside) received share file or folder, the server responds with success response but the shares has no change and the share mountpoint is lost from the me/drives list.

Steps to reproduce

  1. admin, share a folder adminFolder with demo user

  2. demo, create a folder demoFolder in Personal space

  3. demo, try to COPY demoFolder to received share adminFolder from admin

    curl -XCOPY "https://localhost:9200/dav/files/demo/demoFolder" \
    -H"Destination: https://localhost:9200/dav/files/demo/Shares/adminFolder" \
    -udemo:demo -vk
    
    < HTTP/1.1 201 Created
    
  4. demo, check the drives list: no adminFolder share drive ❌

    curl "https://host.docker.internal:9200/graph/v1.0/me/drives" -udemo:demo -vk | jq
    
  5. demo, check the sharedWithMe list: adminFolder share is listed ✔️

    curl "https://host.docker.internal:9200/graph/v1beta1/me/drive/sharedWithMe" -udemo:demo -vk | jq
    
  6. admin, check the file permissions - share entry is there ✔️

    curl "https://host.docker.internal:9200/graph/v1beta1/drives/{admin-drive-id}/items/{adminFolder-id}/permissions" \
    -uadmin:admin -vk | jq
    
@amrita-shrestha
Copy link
Contributor Author

Related issues : #3874 and #4393 may be we can close
cc @micbar @ScharfViktor

@ScharfViktor
Copy link
Contributor

Sorry, I couldn't reproduce it. Is /index.php at the end correct?

My request:

curl 'https://localhost:9200/remote.php/dav/spaces/803119ff-437b-4c58-b0f9-1b4b04910839%24f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/ironman.txt' \
  -X 'COPY' \
  -H $'Destination: https://localhost:9200/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668\u0021803119ff-437b-4c58-b0f9-1b4b04910839%3A4c510ada-c86b-4815-8820-42cdf82c3d51%3A63e09646-6527-4e14-a7a1-ef3b17661af4/ironman.txt' \
  -H 'Overwrite: F' \
  --insecure

@amrita-shrestha
Copy link
Contributor Author

amrita-shrestha commented Aug 10, 2023

Sorry, I couldn't reproduce it. Is /index.php at the end correct?

My request:

curl 'https://localhost:9200/remote.php/dav/spaces/803119ff-437b-4c58-b0f9-1b4b04910839%24f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c/ironman.txt' \
  -X 'COPY' \
  -H $'Destination: https://localhost:9200/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668\u0021803119ff-437b-4c58-b0f9-1b4b04910839%3A4c510ada-c86b-4815-8820-42cdf82c3d51%3A63e09646-6527-4e14-a7a1-ef3b17661af4/ironman.txt' \
  -H 'Overwrite: F' \
  --insecure

Sorry pasted api request where i try to copy index.php file
@ScharfViktor could you try removing ironman.txt from Destination and not setting -H 'Overwrite: F'
-H $'Destination: https://localhost:9200/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668\u0021803119ff-437b-4c58-b0f9-1b4b04910839%3A4c510ada-c86b-4815-8820-42cdf82c3d51%3A63e09646-6527-4e14-a7a1-ef3b17661af4/

@ScharfViktor
Copy link
Contributor

ScharfViktor commented Aug 10, 2023

I don't know how realistic it is to move a file to a shared mount point.

I get 502 Error <s:message>gateway does not support cross storage move, use copy and delete</s:message> and shared folder moves to decline.

I'm interested in the same case(not realistic but) with project space that leads to data loss

Steps:

  • admin creates project space
  • admin shares space to marie (editor or manager role)
  • marie copies file from personal space to project space using:
curl --location --request MOVE 'https://localhost:9200/remote.php/dav/spaces/{personalSpaceUUID}/ironman.txt' \
--header 'Destination: https://localhost:9200/remote.php/dav/spaces/{projectSpaceUUID}' \
--header 'Authorization: Basic bWFyaWU6cmFkaW9hY3Rpdml0eQ=='


result: 500 error and no project space for users
log:
{"level":"error","service":"ocdav","name":"com.owncloud.web.ocdav","traceid":"00000000000000000000000000000000","request-id":"Viktors-Air.local/jtcZawt1wM-000470","spaceid":"803119ff-437b-4c58-b0f9-1b4b04910839$f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c","path":"/ironman.txt","status":{"code":15,"message":"delete:remove /Users/scharfviktor/.ocis/storage/users/spaces/6f/3a6508-db7b-4707-8682-40b843eed187/nodes/New space: no such file or directory","trace":"e139bc77c308591c570fc81aae2de966"},"code":500,"time":"2023-08-10T14:31:50.465315+02:00","message":"Internal Server Error"}

@kobergj
Copy link
Collaborator

kobergj commented Aug 10, 2023

probably same issue like: #6739

@ScharfViktor
Copy link
Contributor

probably same issue like: #6739

Yes, thank you

@ScharfViktor
Copy link
Contributor

like in #6739 /remote.php in Destination url is trigger. without /remote.php I get 400 error and nothing bad happens.

@SwikritiT
Copy link
Contributor

SwikritiT commented Aug 21, 2023

The behavior is the same for copying a folder into a file using the webdav as well but in webdav we get 204 but the share gets declined

Here I'm copying a folder adad to a shared file test.txt then the status code is 204 but the share is declined and the test.txt is not changed.

curl -X COPY -u einstein:relativity 'https://localhost:9200/remote.php/webdav/adad' -H "Destination:  https://localhost:9200/remote.php/webdav/Shares/test.txt" -vk 
response

*   Trying 127.0.0.1:9200...
* Connected to localhost (127.0.0.1) port 9200 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* 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: Aug 21 10:03:10 2023 GMT
*  expire date: Aug 20 10:03:10 2024 GMT
*  issuer: O=Acme Corp; CN=OCIS
*  SSL certificate verify result: self-signed certificate (18), continuing anyway.
* Server auth using Basic with user 'einstein'
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> COPY /remote.php/webdav/adad HTTP/1.1
> Host: localhost:9200
> Authorization: Basic ZWluc3RlaW46cmVsYXRpdml0eQ==
> User-Agent: curl/7.81.0
> Accept: */*
> Destination:  https://localhost:9200/remote.php/webdav/Shares/test.txt
> 
* 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 204 No Content
< Access-Control-Allow-Origin: *
< Content-Security-Policy: default-src 'none';
< Date: Mon, 21 Aug 2023 10:27:05 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/rLnTbi8eJa-002326
< X-Robots-Tag: none
< X-Xss-Protection: 1; mode=block
< 
* Connection #0 to host localhost left intact

Note: In webdav, this request should overwrite the file text.txt converting it to the folder and copying the content of adad inside it. so the new folder should be something like /Shares/text.txt/adad

@saw-jan
Copy link
Member

saw-jan commented Jul 29, 2024

❗ Current behaviour: after performing COPY, the share drive (share mountpoint) got lost while listing the me/drives

Steps to reproduce

  1. admin, share a folder adminFolder with demo user

  2. demo, create a folder demoFolder in Pesronal space

  3. demo, try to COPY demoFolder to received share adminFolder from admin

    curl -XCOPY "https://localhost:9200/dav/files/demo/demoFolder" \
    -H"Destination: https://localhost:9200/dav/files/demo/Shares/adminFolder" \
    -udemo:demo -vk
    
    < HTTP/1.1 201 Created
    
  4. demo, check the drives list: no adminFolder share drive ❌

    curl "https://host.docker.internal:9200/graph/v1.0/me/drives" -udemo:demo -vk | jq
    
  5. demo, check the sharedWithMe list: adminFolder share is listed ✔️

    curl "https://host.docker.internal:9200/graph/v1beta1/me/drive/sharedWithMe" -udemo:demo -vk | jq
    
  6. admin, check the file permissions - share entry is there ✔️

    curl "https://host.docker.internal:9200/graph/v1beta1/drives/{admin-drive-id}/items/{adminFolder-id}/permissions" \
    -uadmin:admin -vk | jq
    

@saw-jan saw-jan changed the title copy personal space file to shared folder root result share in decline state COPY a "folder" to received share "file/folder" seems to work but no change in shares - lost share mountpoint in me/drives Jul 29, 2024
@saw-jan saw-jan changed the title COPY a "folder" to received share "file/folder" seems to work but no change in shares - lost share mountpoint in me/drives COPY a "folder" to received share "file/folder" seems to work but no change in shares - lost share mountpoint in "me/drives" Jul 29, 2024
@saw-jan saw-jan changed the title COPY a "folder" to received share "file/folder" seems to work but no change in shares - lost share mountpoint in "me/drives" COPY a "folder" to received share "file/folder" seems to work but no change in shares - lost share mountpoint in me/drives Jul 29, 2024
@saw-jan saw-jan changed the title COPY a "folder" to received share "file/folder" seems to work but no change in shares - lost share mountpoint in me/drives COPY a folder to received share file/folder seems to work but no change in shares - lost share mountpoint in me/drives Jul 29, 2024
@micbar micbar added the Priority:p2-high Escalation, on top of current planning, release blocker label Jul 29, 2024
@kobergj kobergj self-assigned this Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

6 participants