-
Notifications
You must be signed in to change notification settings - Fork 189
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
moving a file and providing the fileID of the destination destroys data #6739
Comments
I tried to reproduce. There are slight differences but the issue is the same. When moving to a folder
When moving to a space
This ticket will probably need a raise in priority as it can lead to data loss. (not really - but it will look like this) @micbar |
@individual-it
Definitely, it is a defect and we have to prevent data loss. |
Response: |
Tested with Personal - Personal Space (
|
@saw-jan Merget cs3org/reva#4229 to the reva that disallows using the Personal and Project spaces root as a source/destination while move/copy. |
@2403905 I see that the PR changelog describes above but I think the issue here is not related to space root but it is about using folder-id as the destination header. |
Steps to reproduce:
Command: curl -XMOVE "https://localhost:9200/remote.php/dav/spaces/<personal-space-id>/afile.txt" \
-H"Destination: https://localhost:9200/remote.php/dav/spaces/<dest-folder-id>" \
-uadmin:admin -vk Example: curl -XMOVE "https://localhost:9200/remote.php/dav/spaces/fee02af4-bdc5-4ec6-863d-465f5eb4257d\$0126f1a4-01aa-441b-9d9d-e0e808058ff1/afile.txt" \
-H"Destination: https://localhost:9200/remote.php/dav/spaces/fee02af4-bdc5-4ec6-863d-465f5eb4257d\$0126f1a4-01aa-441b-9d9d-e0e808058ff1\!df03d210-6381-4ce2-89a9-5d519ff7c971" \
-uadmin:admin -vk |
@saw-jan Why the issue is not related to space root? The folder case that about using folder-id as the destination header is still opened. We need to fix the decomposefs. |
Yeah, you are right. Sorry for the confusion. I thought the fix was for folder-id realted. Trying to MOVE to space-id as destination is confirmed to be fixed 👍 curl -XMOVE "https://localhost:9200/remote.php/dav/spaces/storage-users-1%24some-admin-user-id-0000-000000000000/afile.txt" \
-H"Destination: https://localhost:9200/remote.php/dav/spaces/storage-users-1%24a73a43f5-260a-4a1d-92ac-42a98248c3b8" \
-uadmin:admin -vk < HTTP/1.1 400 Bad Request |
so now we are waiting for this fix |
can we close it? |
Was there any fix for?
|
There's still an issue with trying to move file to a folder-id as destination HTTP/1.1 500 Internal Server Error
<?xml version="1.0" encoding="UTF-8"?>
<d:error
xmlns:d="DAV"
xmlns:s="http://sabredav.org/ns">
<s:exception></s:exception>
<s:message>move:Decomposedfs: could not move child: rename /home/sawjan/.ocis/storage/users/spaces/df/92eaf2-a807-42cf-a8d4-cb9219b8dc4c/nodes/df/92/ea/f2/-a807-42cf-a8d4-cb9219b8dc4c/move-me.txt /home/sawjan/.ocis/storage/users/spaces/df/92eaf2-a807-42cf-a8d4-cb9219b8dc4c/nodes: file exists</s:message>
</d:error>% CC @micbar |
@micbar The issue is partially solved. We disallowed to use the Personal and Project spaces root as a source. It prevents the data loss. |
@dragotin Could we discuss what we can do with the overwriting folder by file or file by folder? It could affect the clients. |
What is left unclear when reading the rfc? At leas whon tdhe overwrite header is set, the outcome should be clear:
Edit: ah, if the destination is just a node it would be deleted. The old name should be reused, and the fileid of the destination should be changed to the one of the source. |
Tested and confirmed the behavior. curl -XMOVE "https://localhost:9200/remote.php/dav/spaces/<space-id>/afile.txt" \
-H"Destination: https://localhost:9200/remote.php/dav/spaces/<folder-id>" \
-uadmin:admin -vk
|
Describe the bug
When making a WebDAV MOVE request and giving only the fileID of the destination, all the data of the destination folder or space will be destroyed.
Steps to reproduce
Steps to reproduce the behavior:
folder
file-to-be-moved.txt
to the personal spacedest
file-to-be-moved.txt
and the fileId ofdest
file-to-be-moved.txt
withDestination
header pointing to the fileId ofdest
(make sure to addremote.php
to the destination URL, that seems to trigger it)curl -uadmin:admin -k -XMOVE https://localhost:9200/remote.php/dav/spaces/136ffc9b-d317-4219-a0c3-084d5e070c60/file-to-be-moved.txt -H'Destination: https://localhost:9200/remote.php/dav/spaces/33c9baa8-450f-4873-a049-7beb8227face$136ffc9b-d317-4219-a0c3-084d5e070c60!9c495ede-bd11-439f-8496-85c649ef6121' -v
Expected behavior
the folder
dest
should be overwritten with the content of the filefile-to-be-moved.txt
as it happens when using the path of thedest
folderOR
return Error 400, same as it happens when not using
remote.php
in the Destionation URLActual behavior
dest
and all its content are gonespace
file-to-be-moved.txt
to the personal space/graph/v1.0/me/drives
to get the id of the new spacefile-to-be-moved.txt
withDestination
header pointing to:<ocis-url>/remote.php/dav/spaces/<spaceId>
usingremote.php
seems to trigger itExpected behavior
remote.php
in the Destionation URLActual behavior
{"level":"error","service":"ocdav","name":"com.owncloud.web.ocdav","traceid":"00000000000000000000000000000000","request-id":"deepthought3/0nFVzCuvCk-000764","spaceid":"136ffc9b-d317-4219-a0c3-084d5e070c60","path":"/file-to-be-moved.txt","status":{"code":15,"message":"delete:remove /home/artur/.ocis/storage/users/spaces/9f/429b6f-50a8-431d-9e72-ed59b0c52efc/nodes/Neuer Space: no such file or directory","trace":"00000000000000000000000000000000"},"code":500,"time":"2023-07-07T12:52:20.718783329+05:45","message":"Internal Server Error"}
Setup
Please describe how you started the server and provide a list of relevant environment variables or configuration files.
PROXY_ENABLE_BASIC_AUTH=true IDM_ADMIN_PASSWORD=admin bin/ocis server
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: