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

User cannot move shared file to shared folder #6707

Open
dtygel opened this issue Sep 30, 2017 · 16 comments
Open

User cannot move shared file to shared folder #6707

dtygel opened this issue Sep 30, 2017 · 16 comments
Labels
1. to develop Accepted and waiting to be taken care of enhancement feature: sharing

Comments

@dtygel
Copy link

dtygel commented Sep 30, 2017

Steps to reproduce

  1. User A shares folder FO (which is located at root) with User B
  2. User A shares file FI (which is located at root) with User B
  3. User B moves file FI to folder FO

Expected behaviour

File FI should be succesfully moved to folder FO, since the folder is also shared among both users.

Actual behaviour

In user's B view, it seems that everything worked fine. There is no warning, no error message, nothing. But when user B reloads the page, she sees that moving the file didn't work.

In the other way round, if User B had uploaded a file directly into folder FO, and user A tried to move this file out of this folder, the file will disappear to User B, who uploaded the file, definitely, and User A will have this file in his root folder, not shared. This is the expected behaviour in this direction, but the other way round it's not working as expected.

Server configuration

Nexclout in branch master

Operating system:
Ubuntu 16.04

Web server:
Apache

Database:
MySQL

PHP version:
7.2

Nextcloud version: (see Nextcloud admin page)
12.0.1

Updated from an older Nextcloud/ownCloud or fresh install:
Fresh install

Where did you install Nextcloud from:
Github, branch master

Nextcloud log (data/nextcloud.log)

No error in log when doing this operation.

Browser log

No errors in javascript console nor in network.

@rullzer
Copy link
Member

rullzer commented Sep 30, 2017

Please upgrade to 12.0.3. It should be fixed there.

@viniciuscb
Copy link
Member

viniciuscb commented Oct 2, 2017

We pulled 12.0.3, tried again and didn't work.

There is another error that happens when an user tries to move a file from a shared folder A to another shared folder B. I've tried to move this file and received an error message.
I've made the same operation in two steps: moved the file from the shared folder A to my home folder: OK. Then moved the same file from my home folder to a shared folder B: OK too.

@viniciuscb
Copy link
Member

Tested this last error reported by me in the last comment, in nextcloud 13, the error did not happen.

However, the error in this issue, reported by @dtygel , happens in nextcloud 13 (master)

@rullzer
Copy link
Member

rullzer commented Oct 2, 2017

Aaah I missunderstood the problem.

Moving a share into a share is not supported.

@viniciuscb
Copy link
Member

viniciuscb commented Oct 2, 2017

OK @rullzer .
The question is: should we work on this problem?
We want to be able to move a file that is a share to another folder that is a share.
We thought in a solution: unsharing the file and moving it inside the folder.
Specially possible if the owner of the file and of the folder are the same person, and both file and folder are shared with same sharing options (edit allowed, shared to same users/groups/circles).
Will this be accepted into nextcloud core?

@rullzer
Copy link
Member

rullzer commented Oct 2, 2017

The owner of files can do what they want with files.

Like if you have

Root
|--Foo
|--Bar
  |-- text.txt

If the owner wants to move Bar into foo.

Root
|--Foo
  |--Bar
    |-- text.txt

And the owner can share Foo, Bar and text.txt all at the same time.

The reason we don't allow moving shares into shares is twofold:

  1. Things get messy very fast and the owner can lose track of who has access to what.
  2. There are a lot of cases where it might not be allowed. This gets very confusing for the user. If sometimes they can move a share into a share and other times not.

@viniciuscb
Copy link
Member

viniciuscb commented Oct 3, 2017

Hi @rullzer . That is a good explanation.

Besides that, I would like to report a bug, (maybe in other issue?) because when we move a mount point to inside another, it fails silently.
It should throw an error.

The error in lib/private/Files/View.php:1729 does not happen because of a storage wrapper. In my case the Files_Trashbin/Storage (which is a wrapper) is a instance of OCP\Files\IHomeStorage . This error should happen when I move one SharedStorage to inside another.

For the user to whom the file/folder is being shared, the operation seems to have been done perfectly, however when s/he reloads the page, the moved file is in the same place.

Steps to reproduce:
User A: share a file F1 with user B
User A: share a folder F2 with user B
User B: using the web interface (Files), move F1 into F2. No error message reported, seems to be a success.
User B: reload the page, and F1 is outside F2, s/he realizes that the move didn't happen.

Tested in nextcloud 12 and 13 (master).

viniciuscb added a commit to coletivoEITA/server that referenced this issue Oct 3, 2017
When a share is moved inside another, will check if both shares have equivalence in sharing types, permissions and sharing targets. If they have, will remove the sharing of the first and move it inside the second.

This changes a policy in nextcloud and I don't know if this will be accepted.
nextcloud#6707

Signed-off-by: Vinicius Cubas Brand <viniciuscb@gmail.com>
@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
viniciuscb added a commit to coletivoEITA/server that referenced this issue Jun 25, 2018
When a share is moved inside another, will check if both shares have equivalence in sharing types, permissions and sharing targets. If they have, will remove the sharing of the first and move it inside the second.

This changes a policy in nextcloud and I don't know if this will be accepted.
nextcloud#6707

Signed-off-by: Vinicius Cubas Brand <viniciuscb@gmail.com>
@skjnldsv skjnldsv added the 1. to develop Accepted and waiting to be taken care of label Jun 12, 2019
@ghost ghost removed the stale Ticket or PR with no recent activity label Jun 12, 2019
@kadarpik
Copy link

This problem persists in 15, I have fedeated share from external NC, and I can move it only to folders I am not sharing at all.

@ferdiga
Copy link

ferdiga commented Mar 14, 2021

can not move files or directory
from NC 20.0.7
to federated NC 20.0.4
Message "Could not move .... to ...."
or
Message "Could not copy .... to ...."
both Servers are hosted by the same provider.

@ferdiga
Copy link

ferdiga commented Mar 14, 2021

can not move files or directory
from NC 20.0.7
to federated NC 20.0.4
Message "Could not move .... to ...."
or
Message "Could not copy .... to ...."
both Servers are hosted by the same provider.

Neverthless !!! the files and directory have been moved to the other Server

@ferdiga
Copy link

ferdiga commented Mar 14, 2021

FYI owncloud is the old directory from which I used to switch to nextcloud without renaming the directory

[webdav] Fatal: Sabre\DAV\Exception\ServiceUnavailable: at <>

  1. /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Tree.php line 80
    OCA\DAV\Connector\Sabre\Directory->getChild("Family NC")
  2. /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 748
    Sabre\DAV\Tree->getNodeForPath("files/gass/Shared/Family NC")
  3. /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 675
    Sabre\DAV\Server->getCopyAndMoveInfo(Sabre\HTTP\Request {})
  4. /var/www/owncloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpCopy(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
  5. /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 474
    Sabre\DAV\Server->emit("method:COPY", [Sabre\HTTP\Requ ... }])
  6. /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 251
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
  7. /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 319
    Sabre\DAV\Server->start()
  8. /var/www/owncloud/apps/dav/lib/Server.php line 332
    Sabre\DAV\Server->exec()
  9. /var/www/owncloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
  10. /var/www/owncloud/remote.php line 167
    require_once("/var/www/ownclo ... p")

COPY /owncloud/remote.php/dav/files/g/Fam/F
from xxx.xxx.xxx.xxx by me at 2021-03-14T16:19:05+00:00

@ferdiga
Copy link

ferdiga commented Mar 14, 2021

the Server log says "Login failed...."
nevertheless another move process runs and I can also login via WEB into the target srever

@ferdiga
Copy link

ferdiga commented Mar 14, 2021

Now I can not login any more on both servers...
There were too many requests from your network. Retry later or contact your administrator if this is an error.

Will probably have to wait some hours -
IMO not a "Business" like solution

@ferdiga
Copy link

ferdiga commented Mar 14, 2021

can not move files or directory
from NC 20.0.7
to federated NC 20.0.4
Message "Could not move .... to ...."
or
Message "Could not copy .... to ...."
both Servers are hosted by the same provider.

Neverthless !!! the files and directory have been moved to the other Server

The problem seems to be "Service not available" because of "too many logins" or something else..
I noticed that the "Shared" directory can not be listed or only after very long wait
Timeout issue?

@ferdiga
Copy link

ferdiga commented Mar 15, 2021

@ferdiga
Copy link

ferdiga commented Mar 15, 2021

workaround for some case if you just want to move very big directories without intention to create federation shares of this folders!!!

  • create an empty folder on the target machine and share this one.
  • move the content from source to target
  • unshare the target directory
  • move the content of the target directory to the place where it should go initially

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of enhancement feature: sharing
Projects
None yet
Development

No branches or pull requests

8 participants