Skip to content

files:transfer-ownership fails with "not enough free space" when the target quota is unlimited #64019

Description

@jo23sh

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

  1. Object store as primary storage, no totalSizeLimit.
  2. Destination user quota none.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions