Log file shows Error: Operation not permitted when emptying trashbin

Nextcloud version (eg, 20.0.5): 22.2.3
Operating system and version (eg, Ubuntu 20.04): Linux 5.10.52-v7l+ armv7l
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38 (Raspbian)
PHP version (eg, 7.4): 7.3.29

The issue you are facing:
Whenever I delete a file that was moved to the trashbin, I get an error Operation not permitted in the log file, although the file does actually get deleted. I checked permissions on the data and trashbin folders and they look correct to me, user www-data and group www-data got rwx permissions on the folders. This is not stopping operations, it is just that it is annoying as I was doing a lot of files moving and the log file size keeps increasing.

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

Steps to replicate it:

  1. Go to a folder
  2. Select a file
  3. Delete file
  4. Go to trashbin (Deleted Files)
  5. Select file
  6. Select “Delete Permanently”

The output of your Nextcloud log in Admin > Logging:

[PHP] Error: rename(//xxx/Doctos/flie.txt,//XXX/nextcloud/data/user/files_trashbin/files/file.txt.d1657068800): Operation not permitted at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#347

DELETE /remote.php/dav/files/user/xxx/Doctos/files.txt
from 192.168.xx.xx by user at 2022-07-06T00:53:21+00:00

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

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '192.168.xx.xx',
    1 => 'XXX.net',
    2 => 'xxx',
  ),
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'cache_path' => '/mnt/xxx/cache_dir',
  'datadirectory' => '/mnt/xxx/nextcloud/data',
  'overwrite.cli.url' => 'https://192.168.xx.xxx:8443/nextcloud',
  'dbtype' => 'mysql',
  'version' => '22.2.3.0',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'mail_domain' => '***',
  'mail_from_address' => '**',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_sendmailmode' => 'smtp',
  'updater.release.channel' => 'stable',
  'mail_smtphost' => 'smtp.***.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => '**@**.com',
  'mail_smtppassword' => '****',
  'dbname' => '***',
  'dbhost' => '127.0.0.1',
  'dbuser' => '***',
  'dbpassword' => '**',
  'mysql.utf8mb4' => true,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'app_install_overwrite' => 
  array (
    0 => 'occweb',
    1 => 'nextant',
    2 => 'admin_notifications',
  ),
  'encryption.legacy_format_support' => false,
  'encryption.key_storage_migrated' => false,
  'default_phone_region' => 'MX',
);

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

[Tue Jul 05 00:01:42.908055 2022] [mpm_prefork:notice] [pid 3507] AH00163: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1d configured -- resuming normal operations
[Tue Jul 05 00:01:42.908124 2022] [core:notice] [pid 3507] AH00094: Command line: '/usr/sbin/apache2'