Missing shares after using the transfer-ownership command

Hello,

I’m trying to transfer the ownership of some folders from an user that I will delete in the future.

The total size is around 10 GB, the new user has enough storage quota to receive the files.

After using the transfer-ownership command, all the files are moved to the new users, but seems like some shares couldn’t get restored. If I revert the transfer, the shares get restored without issues.

I’m getting this error after using the command from the old user to the new user.

Analysing files of [old_user] ...
  609 [============================]
Collecting all share information for files and folder of [old_user] ...
  124 [============================]
Transferring files to [new_user]/files/transferred from [old_user]                                                                                        47 on 2019-07-24 13-01-01 ...
Restoring shares ...
  38/124 [========>-------------------]  30%
  An unhandled exception has been thrown:
Error: Unsupported operand types in /var/www/nextcloud/lib/private/Share20/Manager.php:325
Stack trace:
#0 /var/www/nextcloud/lib/private/Share20/Manager.php(847): OC\Share20\Manager->generalCreateChecks(Object(OC\Share2                                                                                                                         0\Share))
#1 /var/www/nextcloud/apps/files/lib/Command/TransferOwnership.php(282): OC\Share20\Manager->updateShare(Object(OC\S                                                                                                                         hare20\Share))
#2 /var/www/nextcloud/apps/files/lib/Command/TransferOwnership.php(157): OCA\Files\Command\TransferOwnership->restor                                                                                                                         eShares(Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\TransferOwnership->execut                                                                                                                         e(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /var/www/nextcloud/3rdparty/symfony/console/Application.php(946): Symfony\Component\Console\Command\Command->run(                                                                                                                         Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /var/www/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCom                                                                                                                         mand(Object(OCA\Files\Command\TransferOwnership), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\                                                                                                                         Component\Console\Output\ConsoleOutput))
#6 /var/www/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Ob                                                                                                                         ject(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Sy                                                                                                                         mfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/nextcloud/console.php(96): OC\Console\Application->run()
#9 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

I don’t get that error while doing back the transfer from the new user to the old one.

Did any of you run into this issue before ? It would be perfect if I can get some help.

Thanks in advance

Yeah… I have seen that one recently myself, but didn’t cared about that. Looks like a bug in the share manager. Maybe worth filling a bug on Github about that, if there isn’t one already.