From aeeea8ccdb0164c2ea49d3a5349462a45ccf42d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 1 Dec 2025 09:43:39 +0100 Subject: [PATCH 1/2] fix: Fix orphan shares blocking moving other shares MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Files/View.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 8b3de59eeb0e0..53b788f4967be 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1909,7 +1909,12 @@ private function targetIsNotShared(string $user, string $targetPath): bool { }, $providers)); foreach ($shares as $share) { - $sharedPath = $share->getNode()->getPath(); + try { + $sharedPath = $share->getNode()->getPath(); + } catch (NotFoundException) { + // node is not found, ignoring + continue; + } if ($targetPath === $sharedPath || str_starts_with($targetPath, $sharedPath . '/')) { $this->logger->debug( 'It is not allowed to move one mount point into a shared folder', From 063d0ff1cdb3d6e8e99e01fc1d7dde83d79309cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 2 Dec 2025 09:33:07 +0100 Subject: [PATCH 2/2] fix: Log missing nodes of shares at debug level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Files/View.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 53b788f4967be..f5977c5c0ee68 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1911,8 +1911,11 @@ private function targetIsNotShared(string $user, string $targetPath): bool { foreach ($shares as $share) { try { $sharedPath = $share->getNode()->getPath(); - } catch (NotFoundException) { + } catch (NotFoundException $e) { // node is not found, ignoring + $this->logger->debug( + 'Could not find the node linked to a share', + ['app' => 'files', 'exception' => $e]); continue; } if ($targetPath === $sharedPath || str_starts_with($targetPath, $sharedPath . '/')) {