Files in deleted files but not actually deleted

Nextcloud version (eg, 20.0.5): Nextcloud Hub 7 (28.0.1)
Operating system and version (eg, Ubuntu 20.04): docker on ubuntu 22.04.3
Apache or nginx version (eg, Apache 2.4.25): nginx 1.25.3 docker
PHP version (eg, 7.4): 8.2.14

Summary of issue:

Files appearing in deleted files but I didn’t delete them and they are not actually deleted.

Files syncing setup:

I have my nextcloud on my server running on docker and nginx in a different container.

I’m mapping the nextcloud /var/www/html/data directory as a volume in docker compose:
- /mnt/storage/nextcloud-data:/var/www/html/data

The idea is that I want the data to be on the /storage pool which is mergerfs and is being redundant with snapraid. It’s been working with no issues, that directory has www-data:root ownership and all the files inside are www-data:www-data.

I have the nextcloud macos client and I’m not syncing all the data to be on my mac. I have just the Documents and Notes directory synced on my mac. In the Notes directory, I placed my Obsidian vault directory inside, which also pushes to a git repo every 6hrs. So since the Obsidian directory is syncing to Nextcloud from mac, there will be all these files changes by opening, deleting, moving etc… which is fine, and those changes also end up being seeing in the snapraid’s nightly sync and scrub. I also rarely, if ever, edit or open the obsidian-notes files from nextcloud. It’s a nice option to have though since that would be my only way to access a note on my phone.

Dir structure so far on MacOS:

  • Nextcloud/
    • Notes/
      • obsidian-notes/
    • Documents/

Now inside Documents/ I have 3 directories that have important files in them, and while I trust my self hosting storage setup, I’m still in the process of making it more solid, so I want those backed up to the cloud and for a guaranteed availability in case my server went down.

So I installed google drive client to my mac and I’m not syncing everything down from the drive to my machine, but I selected these 3 directories to be synced to my Google Drive. So anything I upload to these directories from my phone or web app or macos client, will be synced to google drive too. And there is also redundancy with the nextcloud data itself with the snapraid setup.

The concern/problem/issue:

I was checking out the deleted files in my nextcloud web app in my account and I see lots of files. Many of them are numbers-named files (see screenshot below) so I assumed it’s something either because it’s the obisidian-notes files end up being in the deleted files of nextcloud when I delete them, which kinda makes sense, or maybe git versioning or google drive too? Not sure.

However, I also saw some files that aren’t in the obsidian-notes directory and I would remember deleting them, because I don’t know why I would delete them. They are from the Documents directory that is synced with my mac, and not all of the files that are in the deleted files, are from the 3 directories that are synced up to google drive.

The weird part is that those files are not actually deleted. I search them up and they are still where they’re supposed to be, but they’re also in the deleted files. So I’m confused, and even when I click restore on a file that I checked that isn’t deleted, it “restores” it and creates a copy with (1) in the name since there’s already a file in where it came from.

Deleted numbers-named files:

more info

I do have a nightly script that rsyncs the data directory to an external drive for additional backup. It’s been working fine too and no issues. In addition to another weekly archive (tar) backup to the same external drive, but will be changing the archive destination soon.

sudo rsync -Aahx --stats --delete /mnt/storage/nextcloud-data {seagate_backups_path}

So I’m trying to ask here if anyone can see anything in this setup that might cause this? Any ideas to investigate more?

The output of your config.php file

<?php
$CONFIG = array (
  'filesystem_check_changes' => 1,
  '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,
    ),
  ),
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '',
    1 => '',
    2 => '',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '28.0.1.1',
  'overwrite.cli.url' => 'http://.home:',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextclouddb',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '',
  'installed' => true,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
    0 => 'admin',
    1 => 'Users',
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'loglevel' => 2,
  'maintenance' => false,
  'theme' => '',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'i@m',
  'mail_smtppassword' => '',
  'mail_from_address' => '',
  'mail_domain' => '',
);

Update. Was going through my phone and checked the deleted files there, and it shows me more details on the files and shows hidden files. So most of them, if not all, are .iCloud files. See screenshot

I noticed that I have nextcloud macOS client sitting inside my Mac’s Document folder. And that folder is on the iCloud. So I’m assuming that’s what the “.icloud” deleted files are. But there are still some actual files that are shown in the deleted files on my iPhone but they’re still in the directory where they belong.