Bug description
occ files:transfer-ownership aborts with Target user does not have enough free space available. when the destination user has unlimited quota on an instance using object storage as primary storage — it fails precisely because the target has no limit.
Cause
OwnershipTransferService::analyse():
$freeSpace = $view->free_space($destinationUid . '/files/');
if ($size > $freeSpace && $freeSpace !== FileInfo::SPACE_UNKNOWN) {
free_space() returns negative sentinels, but the guard exempts only SPACE_UNKNOWN (-2). For a quota-less user, Quota::free_space() passes through to ObjectStoreStorage::free_space(), which returns SPACE_UNLIMITED (-3) when no totalSizeLimit is set. $size > -3 is true for any non-empty source, so it throws. SPACE_NOT_COMPUTED (-1) has the same flaw.
Not reachable on local primary storage, where an unlimited-quota user gets real disk free space — which is probably why it hasn't surfaced before.
Steps to reproduce
- Object store as primary storage, no
totalSizeLimit.
- Destination user quota
none.
occ files:transfer-ownership --path="<non-empty folder>" <source> <destination>
Workaround
Set a finite quota on the destination, transfer, set it back to none.
Version
34.0.3, and present on master @ 22bd34a.
Bug description
occ files:transfer-ownershipaborts withTarget user does not have enough free space available.when the destination user has unlimited quota on an instance using object storage as primary storage — it fails precisely because the target has no limit.Cause
OwnershipTransferService::analyse():free_space()returns negative sentinels, but the guard exempts onlySPACE_UNKNOWN(-2). For a quota-less user,Quota::free_space()passes through toObjectStoreStorage::free_space(), which returnsSPACE_UNLIMITED(-3) when nototalSizeLimitis set.$size > -3is true for any non-empty source, so it throws.SPACE_NOT_COMPUTED(-1) has the same flaw.Not reachable on local primary storage, where an unlimited-quota user gets real disk free space — which is probably why it hasn't surfaced before.
Steps to reproduce
totalSizeLimit.none.occ files:transfer-ownership --path="<non-empty folder>" <source> <destination>Workaround
Set a finite quota on the destination, transfer, set it back to
none.Version
34.0.3, and present on
master@22bd34a.