Repository navigation
Trash bin does not cleaned up #24957
Description
Activity
- added0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmap
on Jan 4, 2021 Workarround: I switched to "auto, D" because it was not working either! https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#deleted-items-trash-bin
i noticed that if i delete files or folders one by one it works. So, the problem as i think in multiple deletion of all files on page, because if i mark 2 or 3 files for removal they removes too without any issues.
Yes, I can confirm that. Thought with the workaround apperantly it works like a charm. Now I hardly remember I run some commands: "occ" commands in maintenance mode with db repair and (files) cleanup (https://docs.nextcloud.com/server/15/admin_manual/configuration_server/occ_command.html). May it helps!
Hello, I reproduce it also on web version of nextcloud (V 20.0.4).
Initially, I though it was only impacting files from a group shared folder that were trashed. Multiple deletion is not working, but one by one does. I had about 500 files to delete, I almost broke my mouse ;-)
Reacted by Andreas Lord and Chris PuttickI get an error if I try to delete multiple files, not all files. Delete only 1 file works well, also deleting all files. My nextcloud is 20.0.8 but my instance was affected by this bug for many previous version (18? i dont remember...).
Have the same problem on my side. It seems some users are only able to randomly remove files permanent. Others are locked. It's strange the Error message in the trash directory do not contain any value information like the files affected or kind of error.
I did not try to clean up with OCC because many users have this problem and I do not remove data for other users except they wish it.Nextcoud server 20.0.8 - 20.0.8.1 php 7.4.16 mysql 10.3.27 Apache (cgi-fcgi)For the record. If I remove the file one by one It works. It starts failing if I remove to many files in a short time. After every remove of a file I have to wait around a second until I remove the next one.
Reacted by hul51uAs I cannot reproduce the original issue anymore, I will close this ticket. If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen. The latest version can be seen by checking https://nextcloud.com/install/#install-clients and https://nextcloud.com/install/#instructions-server respectively.
Nextcloud 24.0.5: the bug is still here on 2 different hosts - with php 7.4.30 and 8.1.10.
After removing several files in short time can't remove files for 5-10-15 minutes. Then can remove again 20-30 files. Then can't again…As I cannot reproduce the original issue anymore, I will close this ticket. If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen. The latest version can be seen by checking https://nextcloud.com/install/#install-clients and https://nextcloud.com/install/#instructions-server respectively.
For sure this is not the proper way to solve problems in software development (or any other project types).
For some reason, it's not possible to change to the newest version.
In NC-cases most times a depended feature is not supported anymore (i.e. restrict login to ip or share permissions based on group membership or [Activities for shared file downloads, visible to all admins]).
And last but not least, the bug is not fixed in the current version.occ help trashbin:cleanup is not helping either
this command is helpful to empty all files, but not those in GroupFolder
sudo -u www-data php occ trashbin:cleanup --all-users@szaimen Hello,
Almost 3 years have passed and I already have version 28.0.2 and PHP 8.2 but the problem has not been fixed. Despite the fact that the problem is reproduced by other users too. It's a pity.Are you sure that if you couldn't reproduce the problem, then it doesn't exist?
Is it possible to ask to reopen this case and still find some time to analyze the problem? Or at least just keep it open so that other people in the community understand that the problem exists and try to help find a solution?
> /opt/php82/bin/php occ trashbin:cleanup --all-users The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see https://www.php.net/manual/en/book.pcntl.php Additionally the function 'pcntl_signal' and 'pcntl_signal_dispatch' need to be enabled in your php.ini. Remove deleted files for all users Remove deleted files for users on backend Database <user> (i have removed usernames here) <user> <user>But all the contents that were in the trash bin are still there.
If you cannot reproduce this yourself, please tell me why the problem has been reproducing for 3 years now on different versions for me and other users and we will try to figure it out ourselves with your help.
Reacted by punkyardI finally encountered the occ command to clean all the groupfolder bins
sudo -u www-data php /var/www/html/occ groupfolders:trashbin:cleanup
which should only be a workaroundNow all my bins are finally empty - we'll see if we get blocked again ..
I hope this subject will evolve thoughI finally encountered the occ command to clean all the groupfolder bins
sudo -u www-data php /var/www/html/occ groupfolders:trashbin:cleanupwhich should only be a workaroundNow all my bins are finally empty - we'll see if we get blocked again .. I hope this subject will evolve though
I also tried to empty the trash bin itself and group folders through the OCC, but by now the trash bin has become too large and my server is simply restarts due to lack of RAM. After that, errors appear in the server logs after launching the OCC about the timeout. It seems to me that there should be a delay in emptying the trash bin, which the user must set himself depending on the server resources, since the OCC command does not work optimally with a large number of files.
Since the developers do not want to deal with this bug, I will most likely have to study the API documentation and write something in Python that will empty the trash bin via the API not in batches, but in portions at intervals. Little by little.
In this way, it will be possible to gradually empty the basket without overloading the server with requests and without completely using up its resources, as the OCC is doing now.
UPD:
Actually you was right!
groupfolders:trashbin:cleanupis really works. It seems I didn’t try all the options, now your option worked for meReacted by punkyardI'm really glad to hear it helped you, @intervisionlord!
like you I'm expecting a graphical solution to this problem - very soon my apps will be in a managed environment and I won't have access to the command line anymore to do this kind of operation 😷

Steps to reproduce
php occ trashbin:cleanup usernameExpected behaviour
All files should be deleted
Actual behaviour
All deleted files are present in trash bin still
Server configuration
Operating system:
Debian 9
Web server:
Apache+Nginx
Apache/2.4.25
nginx/1.16.1
Database:
MariaDB-10.2.29
PHP version:
PHP 7.4.13
Nextcloud version: (see Nextcloud admin page)
20.0.4
Updated from an older Nextcloud/ownCloud or fresh install:
Updated (this issue was in previous versions too)
Where did you install Nextcloud from:
from github
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: local/smb/sftp/...
No
Are you using encryption: yes/no
No
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No
Client configuration
Browser:
Firefox 84.0.1 (x64)
Operating system:
Windows 10
Logs
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
Browser log
Browser log