Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions lib/Controller/QueueController.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,17 @@ private function getFileSource(QueueFile $document, IRootFolder $rootFolder, Sto
if (empty($mounts)) {
throw new \Exception('Couldn\'t find any mounts for this storage');
}
$userId = $mounts[0]->getUser()->getUID();

try {
$file = $rootFolder->getUserFolder($userId)->getFirstNodeById($document->getFileId());
} catch (NotPermittedException $e) {
throw new \Exception('Not allowed to get user folder');
$file = null;
foreach ($mounts as $mount) {
$userId = $mount->getUser()->getUID();
try {
$file = $rootFolder->getUserFolder($userId)->getFirstNodeById($document->getFileId());
} catch (NotPermittedException $e) {
throw new \Exception('Not allowed to get user folder');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the first mount's user has an inaccessible home folder, mounts 2…N are never tried, and the caller (QueueController.php:126-129) deletes the queue row. That's the exact failure shape the PR set out to fix, just moved from "wrong user" to "broken user". It should continue, and the throw should happen after the loop when nothing resolved.

}
if ($file instanceof File) {
break;
}
}
if (!($file instanceof File)) {
throw new \Exception('File not found or not a file');
Expand Down