Skip to content

Files can not be deleted by the retention job if there is no deletable node for them #142

@danxuliu

Description

@danxuliu

Extracted from #137

To delete a file the retention job checks all the nodes of all the mount points to find one that is deletable. However, if there is no deletable node for a file (for example, if the file is in a group folder without delete permissions) the retention job will not be able to delete the file.

On one hand it makes sense, although on the other hand, given that the app is not tied to any user, only a tag, it could be expectable that it can delete the files anyway.

Steps to reproduce

  • As an admin, create user user0 and add that user to group group0
  • Install and enable the groupfolders app
  • Create a group folder for group0 and remove the Delete permission
    • It seems that group folders admin UI does not work yet with NC 23, so you may need to use OCC commands to associate a group with a group folder (occ groupfolders:group {GROUP_FOLDER_ID} group0 write share)
  • Log in as user0
  • Open the Files app
  • Open the group folder
  • Upload an old file (a file with an mtime from months or years ago) inside the group folder
  • Add a tag deleteTest to the file
  • As an admin, open the Flow admin settings
  • Create a new retention job to delete files with tag deleteTest and a modification time older than 10 days
  • Set debug level for Nextcloud logs with occ config:system:set loglevel --type integer --value 0
  • Wait patiently until the retention job runs or force its execution with occ background-job:execute --force-execute XXX (requires Add a command to show info about a background job and force-execute it server#27217)
    • The following SQL query can be used to find out the job ID; if there is more than one retention job look for the matching tag ID in the arguments: SELECT id, argument FROM oc_jobs WHERE class LIKE "%Files_Retention%"

Expected behaviour

The file is deleted.

Actual behaviour

The file is not deleted. Nextcloud logs show No mount point with delete permissions found for file XXX when trying to delete the file with the retention job.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions