nextcloud / nextcloud/server

[Bug]: `occ files:transfer-ownership` fails with error "Could not get proper share mount"

Open
#33,176 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 25-feedback bug feature: occ feature: sharing needs review
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.
Bug description

While transferring ownership of files, it fails with Could not get proper share mount (see below)

Steps to reproduce
  1. Execute OCC command (see below)
  2. Error
Nextcloud Logs
~$ occ files:transfer-ownership --transfer-incoming-shares=1 source.user dest.user

Validating quota
Analysing files of source.user ...
 42778 [============================]
Collecting all share information for files and folders of source.user ...
    9 [============================]
Transferring files to dest.user/files/transferred from source.user on 2022-07-08 17-23-25 ...
Restoring shares ...
Could not restore share with id 29588:Could not get proper share mount for 60602450. Failing since else the next calls are called with null : #0 /lib/private/Share20/Manager.php(972): OC\Share20\Manager->generalCreateChecks()
#1 /apps/files/lib/Service/OwnershipTransferService.php(421): OC\Share20\Manager->updateShare()
#2 /apps/files/lib/Service/OwnershipTransferService.php(185): OCA\Files\Service\OwnershipTransferService->restoreShares()
#3 /apps/files/lib/Command/TransferOwnership.php(150): OCA\Files\Service\OwnershipTransferService->transfer()
#4 /3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\TransferOwnership->execute()
#5 /3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#6 /3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#7 /3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#8 /lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run()
#9 /console.php(99): OC\Console\Application->run()
#10 /occ(11): require_once('...')
#11 {main}
 1/9 [===>------------------------]  11%Could not restore share with id 33797:Could not get proper share mount for 60218539. Failing since else the next calls are called with null : #0 /lib/private/Share20/Manager.php(972): OC\Share20\Manager->generalCreateChecks()
#1 /apps/files/lib/Service/OwnershipTransferService.php(421): OC\Share20\Manager->updateShare()
#2 /apps/files/lib/Service/OwnershipTransferService.php(185): OCA\Files\Service\OwnershipTransferService->restoreShares()
#3 /apps/files/lib/Command/TransferOwnership.php(150): OCA\Files\Service\OwnershipTransferService->transfer()
#4 /3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\TransferOwnership->execute()
#5 /3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#6 /3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#7 /3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#8 /lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run()
#9 /console.php(99): OC\Console\Application->run()
#10 /occ(11): require_once('...')
#11 {main}
 9/9 [============================] 100%
Collecting all incoming share information for files and folders of source.user ...
    5 [============================]
Collecting all incoming share information for files and folders of dest.user ...
    1 [============================]
Restoring incoming shares ...
 5/5 [============================] 100%

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/files/lib/Command/TransferOwnership.php and apps/files/lib/Service/OwnershipTransferService.php, following the restoreShares call into lib/private/Share20/Manager.php around generalCreateChecks and updateShare. Reproduce with occ files:transfer-ownership --transfer-incoming-shares=1 using shares that trigger the reported error. Done means ownership transfer restores the affected shares without the “Could not get proper share mount” failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.