Mass Deletion from Groupfolder – 30,000 files in trash, OC\User\NoUserException, Trash Restore Path Missing

Hi everyone,

I’m experiencing a critical issue with our self-hosted Nextcloud installation and would appreciate any input or confirmation before proceeding further.


Situation

Recently, a Groupfolder (ID 2) suddenly had approximately 30,000 files deleted and moved to the trashbin. According to the Nextcloud activity logs, the admin user performed these deletions — but no such action was knowingly taken.

Environment:

  • Nextcloud version: 27.1.3
  • Ubuntu 22.04 LTS (in a VM on Unraid)
  • Apache 2.4, PHP 8.1
  • No reverse proxy, no mod_security, no Cloudflare
  • Groupfolders app is in use

Observations

  • Deleted files now reside in:
    /mnt/data/ncdata/__groupfolders/trash/2/
  • The corresponding trash-bin-info.json file is missing, so original paths are lost.
  • In the Web UI:
    • The trashbin is visible
    • Search is not available
    • Manually restoring via the GUI does return files to the correct folder, but it’s impractical with 30,000+ items

Logs

Error 1 — possibly related to deletion process:

OC\User\NoUserException: Backends provided no user object
at OCA\GroupFolders\Versions\GroupVersionsExpireManager->expireAll()

Error 2 — database constraint violation when deleting:

SQLSTATE[23000]: Integrity constraint violation:
Duplicate entry '2-Filename.xls-1750617902' for key 'groups_folder_trash_unique'

Additional context

  • Disk usage was at 95% when the incident occurred
  • Disk size has since been expanded, now at 68% used
  • All background jobs are currently active (nothing has been disabled)
  • Files can be restored via GUI, but the volume is too large to handle manually

Questions

  1. Can this deletion be explained by ExpireGroupVersions or another process under high disk pressure?
  2. Is it possible to reconstruct trash-bin-info.json or determine the original path from DB?
  3. Is there a safe, supported method to bulk-restore Groupfolder trashbin files?
  4. If not, could this be handled via CLI (occ), database, or WebDAV API?

Any guidance is appreciated. We are trying to avoid data loss and restore all content properly.

Thanks in advance.

See the Admin Manual:

occ trashbin:restore is covered here.

EDIT: Actually you may not be able to do this; support for restoring groupfolders in this way was added ~2 years ago but your installation is likely too old to support this.

  • Nextcloud version: 27.1.3

Unfortunately you’re running a very out-of-date version. Not only is v27/v27.1 end-of-life, but your deployment is missing numerous bug fixes even within the v27.1 series. The last maintenance release of v27.1 was v27.1.11.

Additionally, since you’re not on a supported release you also running an ancient version of the Groupfolders app so it’s near impossible to troubleshoot or assess whether any already fixed bugs may or may not apply to your situation.

According to the Nextcloud activity logs, the admin user performed these deletions — but no such action was knowingly taken.

Going forward, I would encourage you to utilize the admin_audit app to log critical actions.

Can this deletion be explained by ExpireGroupVersions or another process under high disk pressure?

No.

Is it possible to reconstruct trash-bin-info.json or determine the original path from DB?

Not sure what trash-bin-info.json is; never heard of that. Trash bin items for group folders, however, are stored in the group_folders_trash db table. You can see the table structure sort of here.

1 Like