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
- Can this deletion be explained by
ExpireGroupVersions
or another process under high disk pressure? - Is it possible to reconstruct
trash-bin-info.json
or determine the original path from DB? - Is there a safe, supported method to bulk-restore Groupfolder trashbin files?
- 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.