Skip to content

fix: skip inaccessible shares in ownership transfer - #49164

Closed
kesselb wants to merge 1 commit into
masterfrom
bug/noid/skip-exceptions-in-transfer-ownership
Closed

fix: skip inaccessible shares in ownership transfer#49164
kesselb wants to merge 1 commit into
masterfrom
bug/noid/skip-exceptions-in-transfer-ownership

Conversation

@kesselb

Copy link
Copy Markdown
Contributor

Summary

My experience with transfer ownership is limited, so I’m open to feedback on whether this approach makes sense or if there’s a better way to handle this issue.

How to reproduce:

  • Share a file from alice to bob
  • Delete the record in oc_filecache for the file
  • Trigger the transfer ownership from alice to admin
  • See the stack trace below

Why should we not merge this patch:

Deleting the row in oc_filecache was my workaround to trigger the exception, however that's not the case for the customer case. The row and file do exist.

occ files:transfer-ownership bob admin -vvv
Validating quota
Analysing files of bob ...
0 [->--------------------------] < 1 sec 50.5 MiB
Collecting all share information for files and folders of bob ...
1 [============================] < 1 sec 50.5 MiB
In View.php line 1777:
[OCP\Files\NotFoundException]
File with id "222702" has not been found.
Exception trace:
at lib/private/Files/View.php:1777
OC\Files\View->getPath() at apps/files/lib/Service/OwnershipTransferService.php:345
OCA\Files\Service\OwnershipTransferService->{closure:OCA\Files\Service\OwnershipTransferService::collectUsersShares():343}() at n/a:n/a
array_map() at apps/files/lib/Service/OwnershipTransferService.php:343
OCA\Files\Service\OwnershipTransferService->collectUsersShares() at apps/files/lib/Service/OwnershipTransferService.php:137
OCA\Files\Service\OwnershipTransferService->transfer() at apps/files/lib/Command/TransferOwnership.php:112
OCA\Files\Command\TransferOwnership->execute() at 3rdparty/symfony/console/Command/Command.php:326
Symfony\Component\Console\Command\Command->run() at 3rdparty/symfony/console/Application.php:1078
Symfony\Component\Console\Application->doRunCommand() at 3rdparty/symfony/console/Application.php:324
Symfony\Component\Console\Application->doRun() at 3rdparty/symfony/console/Application.php:175
Symfony\Component\Console\Application->run() at lib/private/Console/Application.php:187
OC\Console\Application->run() at console.php:87
require_once() at occ:11

TODO

  • ...

Checklist

When transferring share ownership, the process may fail if the source node is inaccessible. This patch addresses the issue by catching the error, outputting a warning, and allowing the transfer process to continue.
occ files:transfer-ownership bob admin -vvv
Validating quota
Analysing files of bob ...
0 [->--------------------------] < 1 sec 50.5 MiB
Collecting all share information for files and folders of bob ...
1 [============================] < 1 sec 50.5 MiB
In View.php line 1777:
[OCP\Files\NotFoundException]
File with id "222702" has not been found.
Exception trace:
at lib/private/Files/View.php:1777
OC\Files\View->getPath() at apps/files/lib/Service/OwnershipTransferService.php:345
OCA\Files\Service\OwnershipTransferService->{closure:OCA\Files\Service\OwnershipTransferService::collectUsersShares():343}() at n/a:n/a
array_map() at apps/files/lib/Service/OwnershipTransferService.php:343
OCA\Files\Service\OwnershipTransferService->collectUsersShares() at apps/files/lib/Service/OwnershipTransferService.php:137
OCA\Files\Service\OwnershipTransferService->transfer() at apps/files/lib/Command/TransferOwnership.php:112
OCA\Files\Command\TransferOwnership->execute() at 3rdparty/symfony/console/Command/Command.php:326
Symfony\Component\Console\Command\Command->run() at 3rdparty/symfony/console/Application.php:1078
Symfony\Component\Console\Application->doRunCommand() at 3rdparty/symfony/console/Application.php:324
Symfony\Component\Console\Application->doRun() at 3rdparty/symfony/console/Application.php:175
Symfony\Component\Console\Application->run() at lib/private/Console/Application.php:187
OC\Console\Application->run() at console.php:87
require_once() at occ:11
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselbkesselb self-assigned this Nov 8, 2024
@kesselbkesselb added 2. developing Work in progress bug labels Nov 8, 2024
@kesselb

Copy link
Copy Markdown
ContributorAuthor

Replaced by #49761

@kesselbkesselb closed this Jan 16, 2025
@kesselb
kesselb deleted the bug/noid/skip-exceptions-in-transfer-ownership branch January 16, 2025 16:57
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developingWork in progressbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@kesselb