Hey folks,
I think I found the solution to this issue!
It drove me CRYZY until I started to trace the error down through its numerous stages:
- At first, it quickly turned out that the call
$view->rename($this->sourcePath, $this->finalTarget);inapps/files/libs/Command/TransferOwnership.phpreturned false, so it was actually reporting that moving the directory was failing, but the CLI script did not check the return (Turns out to be the actual bug here…). - Next, I tried to figure out why on earth the move operation was not succeeding. Finally, after tracing the “false” return all the way down to the storage wrapper class, I ended up in
lib/private/Files/Storage/Wrapper/Quota.phpwhere I found this:
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
$free = $this->free_space($targetInternalPath);
if ($free < 0 or $this->getSize($sourceInternalPath, $sourceStorage) < $free) {
return $this->storage->moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
} else {
return false;
}
}
And yep, that’s it: I forgot to check that the target user has enough storage quota to hold all the data moved from the source user!
Time to get up and hit my head against something solid…
It’s not unlikely that some if not all of you stumbled upon the same mistake, so I hope this helps some people… Meanwhile, I’m going to open an issue for this.