Why i see different space usage?

Nextcloud version (eg, 20.0.5): Nextcloud Hub 4 (26.0.1)
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04, nextcloud dockerized
Apache or nginx version (eg, Apache 2.4.25): included into latest docker image
PHP version (eg, 7.4): included into latest docker image, PHP 8.1.19

The issue you are facing:
There is 2 things which I take from AWS. First is EC2 where is installed ubuntu and docker and S3 as primary storage for nextcloud. My problem is that I see different values of using space and Im curious it is bug, feature or I configured something wrong. In the admin panel I see 3 users, where summary they use (27.6GB + 32GB + 28.3GB) 87,9GB but in AWS Console whole AWS S3 bucket has size of 413.6 GB !!!. Bucket versioning is disabled.

Question is. How to verify why I use so huge amount of space on AWS.

After deep thought. There is problem with deleting files. After that when I remove file via www and empty trash with command ./occ trashbin:clean --all-users Iā€™m facing with below errors.

Steps to replicate it:

  1. Upload file
  2. Remove file with any way method (windows client or www)
  3. Purge trash
  4. Check if file still exist on AWS S3

The output of your Nextcloud log in Admin > Logging:

1.
{"reqId":"xTxyjilBsDpdHS6qJcVv","level":3,"time":"2023-07-08T10:38:02+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Undefined array key \"key\" at /var/www/html/apps/files_external/lib/Lib/Storage/AmazonS3.php#86","userAgent":"--","version":"26.0.1.1","data":{"app":"PHP"},"id":"64a93ca07887a"}

2.
{"reqId":"OUrsZN6HJDA4AOeMe5Km","level":3,"time":"2023-07-08T10:27:25+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Undefined array key \"key\" at /var/www/html/apps/files_external/lib/Lib/Storage/AmazonS3.php#86","userAgent":"--","version":"26.0.1.1","data":{"app":"PHP"},"id":"64a93ca07888a"}

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'overwriteprotocol' => 'https',
  'trusted_proxies' =>
  array (
    0 => '10.254.254.0/24',
  ),
  'objectstore' =>
  array (
    'class' => '\\OC\\Files\\ObjectStore\\S3',
    'arguments' =>
    array (
      'bucket' => 'bucket name',
      'key' => 'aws_key',
      'secret' => 'aws_secret',
      'region' => 'eu-central-1',
      'hostname' => '',
      'port' => '',
      'objectPrefix' => 'urn:oid:',
      'autocreate' => false,
      'use_ssl' => false,
      'use_path_style' => false,
      'legacy_auth' => false,
    ),
  ),
  'instanceid' => 'oclirulks114',
  'passwordsalt' => 'salt',
  'secret' => 'secret',
  'trusted_domains' =>
  array (
    0 => 'domain1',
    1 => 'domain2',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '26.0.1.1',
  'overwrite.cli.url' => 'HTTPS://my_url',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextcloud-db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'my_db_login',
  'dbpassword' => 'my_db_password',
  'installed' => true,
  'loglevel' => 2,
  'maintenance' => false,
);

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

symbolic link to /dev/stderr

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

https://pastebin.com/YAm5qxQz