Skip to content

Trash bin does not cleaned up #24957

Description

@intervisionlord

Steps to reproduce

  1. Open trash bin for user via web interface
  2. Select all files and select option to completly delete them
  3. Open trash bin again and files would be there
  4. Try to cleanup trash bin via OCC command php occ trashbin:cleanup username
  5. Open trash bin in web-interface again
  6. Files would be there anyway

Expected 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
No errors have been found.

List of activated apps:

App list
Enabled:
  - activity: 2.13.4
  - admin_audit: 1.10.0
  - announcementcenter: 4.0.0
  - apporder: 0.11.0
  - bookmarks: 4.0.5
  - breezedark: 20.0.2
  - bruteforcesettings: 2.0.1
  - calendar: 2.1.3
  - cloud_federation_api: 1.3.0
  - comments: 1.10.0
  - contacts: 3.4.2
  - contactsinteraction: 1.1.0
  - dav: 1.16.2
  - extract: 1.3.0
  - federatedfilesharing: 1.10.2
  - files: 1.15.0
  - files_mindmap: 0.0.24
  - files_pdfviewer: 2.0.1
  - files_rightclick: 0.17.0
  - files_sharing: 1.12.1
  - files_trashbin: 1.10.1
  - files_versions: 1.13.0
  - files_videoplayer: 1.9.0
  - groupfolders: 8.2.0
  - logreader: 2.5.0
  - lookup_server_connector: 1.8.0
  - metadata: 0.12.0
  - music: 0.17.3
  - notes: 4.0.2
  - notifications: 2.8.0
  - oauth2: 1.8.0
  - password_policy: 1.10.1
  - passwords: 2020.12.1
  - phonetrack: 0.6.5
  - photos: 1.2.1
  - privacy: 1.4.0
  - provisioning_api: 1.10.0
  - qownnotesapi: 20.9.0
  - settings: 1.2.0
  - systemtags: 1.10.0
  - text: 3.1.0
  - theming: 1.11.0
  - twofactor_backupcodes: 1.9.0
  - updatenotification: 1.10.0
  - viewer: 1.4.0
  - workflow_script: 1.5.0
  - workflowengine: 2.2.0
Disabled:
  - accessibility
  - dashboard
  - encryption
  - federation
  - files_external
  - firstrunwizard
  - nextcloud_announcements
  - recommendations
  - serverinfo
  - sharebymail
  - support
  - survey_client
  - user_ldap
  - user_status
  - weather_status

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "20.0.4.0",
        "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "theme": "",
        "loglevel": 0,
        "app_install_overwrite": [
            "calendar"
        ],
        "mysql.utf8mb4": true,
        "simpleSignUpLink.shown": false,
        "updater.release.channel": "stable",
        "mail_sendmailmode": "smtp",
        "mail_smtpsecure": "ssl"
    }
}

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
***REMOVED SENSITIVE VALUE*** - - [05/Jan/2021:01:04:17 +0300] "DELETE /remote.php/dav/trashbin/***REMOVED SENSITIVE VALUE***/trash HTTP/1.0" 204 525 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"L9EsjqHji9lUaqP9Njrz","level":0,"time":"2021-01-04T22:01:37+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"contacts","method":"DELETE","url":"/remote.php/dav/trashbin/***REMOVED SENSITIVE VALUE***/trash","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.4.0"}
{"reqId":"L9EsjqHji9lUaqP9Njrz","level":0,"time":"2021-01-04T22:01:37+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"groupfolders","method":"DELETE","url":"/remote.php/dav/trashbin/***REMOVED SENSITIVE VALUE***/trash","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.4.0"}
{"reqId":"L9EsjqHji9lUaqP9Njrz","level":0,"time":"2021-01-04T22:01:37+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"files_sharing","method":"DELETE","url":"/remote.php/dav/trashbin/***REMOVED SENSITIVE VALUE***/trash","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.4.0"}
{"reqId":"L9EsjqHji9lUaqP9Njrz","level":0,"time":"2021-01-04T22:01:37+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"music","method":"DELETE","url":"/remote.php/dav/trashbin/***REMOVED SENSITIVE VALUE***/trash","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.4.0"}
{"reqId":"z0HGmbFY7laWnXtV3Ykl","level":0,"time":"2021-01-04T22:01:38+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"contacts","method":"PROPFIND","url":"/remote.php/dav/files/***REMOVED SENSITIVE VALUE***/","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)","version":"20.0.4.0"}
{"reqId":"z0HGmbFY7laWnXtV3Ykl","level":0,"time":"2021-01-04T22:01:38+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"groupfolders","method":"PROPFIND","url":"/remote.php/dav/files/***REMOVED SENSITIVE VALUE***/","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)","version":"20.0.4.0"}
{"reqId":"z0HGmbFY7laWnXtV3Ykl","level":0,"time":"2021-01-04T22:01:38+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"files_sharing","method":"PROPFIND","url":"/remote.php/dav/files/***REMOVED SENSITIVE VALUE***/","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)","version":"20.0.4.0"}
{"reqId":"z0HGmbFY7laWnXtV3Ykl","level":0,"time":"2021-01-04T22:01:38+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"music","method":"PROPFIND","url":"/remote.php/dav/files/***REMOVED SENSITIVE VALUE***/","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)","version":"20.0.4.0"}
{"reqId":"ABJEpBbs0KMHbtf1DuJU","level":0,"time":"2021-01-04T22:01:39+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"apporder","method":"POST","url":"/apps/text/session/sync","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.4.0"}
{"reqId":"ABJEpBbs0KMHbtf1DuJU","level":0,"time":"2021-01-04T22:01:39+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"contacts","method":"POST","url":"/apps/text/session/sync","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.4.0"}
{"reqId":"ABJEpBbs0KMHbtf1DuJU","level":0,"time":"2021-01-04T22:01:39+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"groupfolders","method":"POST","url":"/apps/text/session/sync","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.4.0"}

Browser log

Browser log
a) The javascript console log
$ is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own. 34 globals.js:60:15
OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment 17 util.js:130:10
$ is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own. 18 globals.js:60:15
$ is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own. globals.js:60:15
jQuery is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own. 2 globals.js:60:15

Activity

  1. elgorro commented on Jan 6, 2021

    @elgorro
  2. intervisionlord commented on Jan 6, 2021

    @intervisionlord
    Author

    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.

  3. elgorro commented on Jan 6, 2021

    @elgorro

    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!

  4. kurn77 commented on Jan 11, 2021

    @kurn77

    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 ;-)

  5. hul51u commented on Mar 5, 2021

    @hul51u

    I 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...).

  6. Mannshoch commented on Mar 26, 2021

    @Mannshoch

    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)
    
  7. Mannshoch commented on Mar 26, 2021

    @Mannshoch

    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.

  8. szaimen commented on Jul 2, 2021

    @szaimen
    Contributor

    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.

  9. VVD commented on Sep 18, 2022

    @VVD

    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…

  10. thekk1 commented on Dec 13, 2022

    @thekk1

    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.

  11. punkyard commented on Jul 26, 2023

    @punkyard

    Hi
    I cant delete all files neither one by one

    Capture d’écran 2023-07-26 à 16 11 22

    NC 26.0.3
    AIO 6.3

    REQ : please add the auto delition options in Admin

  12. punkyard commented on Feb 21, 2024

    @punkyard

    occ help trashbin:cleanup is not helping either

  13. punkyard commented on Feb 21, 2024

    @punkyard

    this command is helpful to empty all files, but not those in GroupFolder

    sudo -u www-data php occ trashbin:cleanup --all-users

  14. intervisionlord commented on Feb 23, 2024

    @intervisionlord
    Author

    @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.

  15. punkyard commented on Feb 23, 2024

    @punkyard

    I 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 workaround

    Now all my bins are finally empty - we'll see if we get blocked again ..
    I hope this subject will evolve though

  16. intervisionlord commented on Feb 24, 2024

    @intervisionlord
    Author

    I 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 workaround

    Now 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:cleanup is really works. It seems I didn’t try all the options, now your option worked for me

  17. punkyard commented on Mar 5, 2024

    @punkyard

    I'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 😷

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions