Deleted files don't go into the trashbin, they just disappear

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version: 22.2.2
Operating system and version: Raspberry Pi OS
Apache or nginx version: Apache 2.4.25
PHP version: 7.3

The issue you are facing:

  1. A file is deleted, trashbin is empty.
  2. A folder is deleted: trashbin contains the just deleted folder (only the folder, not the files in it contained)

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Create a file
  2. Delete that file
  3. Go to Deleted files
  4. Bin is empty

The output of your Nextcloud log in Admin > Logging:

Nothing is reported in the log

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => 'xyz',
  'secret' => 'xyz',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    11 => 'xyz',
    1 => '192.168.1.2',
    5 => 'nextcloudpi.local',
    7 => 'nextcloudpi',
    8 => 'nextcloudpi.lan',
    12 => 'xyz',
    3 => 'raspberrypi',
    22 => '192.168.1.2',
    '' => 'raspberrypi',
  ),
  'datadirectory' => '/mnt/ncHD/nxtcd/ncdata',
  'dbtype' => 'mysql',
  'version' => '22.2.2.0',
  'overwrite.cli.url' => 'https://raspberrypi/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xyz',
  'dbpassword' => 'xyz',
  'installed' => true,
  'instanceid' => 'oczcq4nkftre',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => 'xyz',
  ),
  'tempdirectory' => '/mnt/ncHD/nxtcd/ncdata/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'logfile' => '/mnt/ncHD/nxtcd/ncdata/nextcloud.log',
  'mail_sendmailmode' => 'smtp',
  'loglevel' => '2',
  'log_type' => 'file',
  'trusted_proxies' => 
  array (
    11 => '127.0.0.1',
    13 => 'raspberrypi',
    14 => '',
  ),
  'data-fingerprint' => 'xyz',
);

The output of your Apache/nginx/system log in /var/log/____:

[19/Nov/2021:18:39:36 +0000] "DELETE /remote.php/dav/files/admin/sdfsd.md HTTP/2.0" 204 56 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
[19/Nov/2021:18:39:37 +0000] "GET /index.php/apps/files/ajax/getstoragestats.php HTTP/2.0" 200 185 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"
[19/Nov/2021:18:39:37 +0000] "GET /index.php/apps/files/ajax/getstoragestats.php?dir=%2F HTTP/2.0" 200 227 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0"

I’m facing a similar situation, but also deleted folders are deleted instantly (no trash).

No log entries as well.

No difference between user types (normal/admin or local/AD).

When deleting from groupfolders, trashbin works correctly.

Nextcloud version: 27.1.5
Operating system and version: Ubuntu 22.04.3 LTS
Apache or nginx version: Apache/2.4.52
PHP version: 8.1.2
MariaDB: 10.6.12

Was there a solution found (as it is an older topic…) or are there any ideas? Thanks!

I am facing the same issue but I am getting a log. Started after updating to 27.1.6

When I try to delete a file off of external storage, it gets deleted but I get the following log after it fails to show up in the trash bin:

[PHP] Error: rename(//mnt/usb-WD_easystore_2647_575832324437313232564848-0:0-part1/com.mgoogle.android.gms.apk,//var/www/nextcloud/data/Whatnoww/files_trashbin/files/com.mgoogle.android.gms.apk.d1706385628): Operation not permitted at /var/www/nextcloud/lib/private/Files/Storage/Local.php#393

DELETE /nextcloud/remote.php/dav/files/Whatnoww/Files/com.mgoogle.android.gms.apk

I am on Nextcloud 27.1.6, PHP 8.2.8
Ubuntu 22.04.3 LTS

I’ve verified that www-data has access to the nextcloud var directory and have “chowned” it to www-data.

Same thing happening here.
Nextcloud 27.1.6, PHP 8.0.30
Rocky Linux 8.9

The files are actually present in the users’ files_trashbin folder when checking in the OS itself.
It is very similar to this issue: https://github.com/nextcloud/server/issues/9706
however, nothing abnormal seems to be logged to NC, PHP or Apache logs.

I tried cleaning my own trashbin via occ, deleted some files, but still couldn’t see them.

Same problem here.
Nextcloud is running through Docker (not AIO) and the main storage is on a NFS server.

Versions are:
Nextcloud 27.1.6.2 - MariaDB 11.2.2 - PHP 8.2.15 - nginx 1.24.0

Just like those who have the same problem, files are present in the trashbin but they are not displayed through WebUI. And nothing abnormal seems to be logged, whether PHP or Nginx.

Files rights are all “www-data:www-data” and “trashbin_retention_obligation” is set to “30, auto”.

Help would be welcome!

At least in the case of @Daichi42 and @Undefined_ID it’s a known issue that has already been fixed but won’t appear until v27.1.7. The files still exist on-disk but just aren’t visible in the UI.

Solved in version 28

While the bug discussed below (WebUI…) was fixed in v28 / 27.1.7, the situation I described was not affected by this.

I found out there was an unwanted configuration of the value “trashbin_size”:“0” (no idea where it came from)…:

"files_trashbin": {
            "enabled": "yes",
            "installed_version": "1.17.0",
            "trashbin_size": "0",
            "types": "filesystem,dav"
        },

After deleting the value, trashbin worked fine again:

occ config:app:delete files_trashbin trashbin_size

As it was no error/bug - just a misconfiguration - no log messages appeared :wink:

1 Like