'Path already shared with this group' after transfer-ownership of folder - 10.0.4

Steps to reproduce

  1. Large group share under dedicated owncloud user. Several contributors to group.
  2. User duplicates entire share into a subfolder of the 'master' share as a mistake (backup mistake)
  3. I use transfer-ownership on this duplicate folder (~3 folders deep of master share) to move it to their personal folder to sort out.
  4. After the operation completes, the master share from step 1 is showing as not shared in web interface. Also all group members lose the share from their clients, it doesn't show up in 'shared with me' for any group members.
  5. I try and re-share the folder from the dedicated file sharing user in the web interface and get 'Path already shared with this group'. (Also happens with a User that this was shared with specifically). However I am able to share it with individuals or groups it wasn't previously shared with.

Expected behaviour

Root share should never have disappeared after transfer-ownership command of specific folder within share

Actual behaviour

Root share vanished and now won't allow me to share again

Server configuration

Operating system: Ubuntu LTS 16.04.03

Web server: Apache 2.4.18-2ubuntu3.5

Database: mysql 5.7.20-0ubuntu0.16.04.1

PHP version:PHP 7.0.22-0ubuntu0.16.04.1

ownCloud version: (see ownCloud admin page)10.0.4

Updated from an older ownCloud or fresh install: Updated from 9 and beyond

Where did you install ownCloud from: repo

Signing status (ownCloud 9.0 and above):

No errors have been found.

The content of config/config.php:

https://pastebin.com/sxHZHN4J

List of activated apps:
Enabled:
- activity: 2.3.6
- comments: 0.3.0
- configreport: 0.1.1
- dav: 0.3.2
- federatedfilesharing: 0.3.1
- federation: 0.1.0
- files: 1.5.1
- files_external: 0.7.1
- files_pdfviewer: 0.8.2
- files_sharing: 0.10.1
- files_texteditor: 2.2.1
- files_trashbin: 0.9.1
- files_versions: 1.3.0
- files_videoplayer: 0.9.8
- firstrunwizard: 1.1
- gallery: 16.0.2
- market: 0.2.3
- notifications: 0.3.2
- provisioning_api: 0.5.0
- systemtags: 0.3.0
- templateeditor: 0.1
- updatenotification: 0.2.1
Disabled:
- encryption
- external
- theme-example
- user_external

Are you using external storage, if yes which one: separate local volume (no)

Are you using encryption:no

Client configuration

Browser: google chrome

Operating system: Mac OS

Logs

Web server error log

ownCloud log (data/owncloud.log)

Browser log

Do you have the exact commands you were using by chance?

I've just checked my bash history and I can't find the command which is odd. It would have been sudo -u www-data php occ files:transfer-ownership --path="path/within/master/share" mastershareuser userwhomessedup

I remember the output summarising how many files had been moved and it said 2 shares had been restored which I found odd. I checked the user's profile and there were no shares on the transferred folder.

Old topic, but encountered same problem in Nextcloud 14 after moving (not shared) directory from one user home dir into another.

Solution is to change in database, oc_share table.

select * from oc_share where file_target like '/Your AlreadyShared Share What Seems to Be Lost Now%';

See uid_owner and uid_initiator is changed to new user (instead of old, what it should be).

For me it was needed to be “admin”, so I’ve changed it:

update oc_share set uid_initiator='admin' where id=73;

UPDATE 1

nextcloud=# update oc_share set uid_initiator='admin' where id=5;

UPDATE 1

Nice, thanks for sharing your solution

Hey,

i think the question remains if a solution for Nextcloud is also valid for ownCloud? It could be also possible that this workaround isn’t required at all for ownCloud.