File "my_lost_file.txt" is not anymore on server. Going to delete it locally. - Nextcloud deletes files

Nextcloud version : 21-fpm
Operating system and version : docker
Apache or nginx version : nginx
PHP version : 7.4.16

I am running a docker-compose installation of nextcloud.
Here’s the compose file

services:
  db:
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    volumes:
      - /data/ncloud/mysql:/var/lib/mysql
    environment:
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_USER=${MYSQL_USER}
    ports:
      - 3306:3306

  app:
    image: nextcloud:21-fpm
    restart: always
    volumes:
      - /data/ncloud/data:/var/www/html
    environment:
      - MYSQL_HOST=db
    env_file:
      - db.env
    depends_on:
      - db

  web:
    image: nginx:latest
    restart: always
    ports:
      - 443:443
    volumes:
      - /data/ncloud/data:/var/www/html:ro
      - ./web/nginx.conf:/etc/nginx/nginx.conf
      - ./certs:/certs
    depends_on:
      - app

The only one notable thing about configuration is that all volumes are bind mounts.

I ran a 1st sync from the windows pc client to put around 20,000 files on the server with total size of 80Gb. It took a while and finished in 10 hours or so.

Next strange thing I noticed is that every time I run a nextcloud client - it starts checking the status of all 20,000 files.

Later on I found that on a client PC some files are missing and here’s the log from the client:

./20210616_1033_owncloud.log.0:2021-06-16 10:35:14:420 [ info sync.discovery ]: File "my_lost_file.txt" is not anymore on server. Going to delete it locally.

./20210616_1033_owncloud.log.0:2021-06-16 10:35:14:420 [ info sync.discovery ]: Discovered "my_lost_file.txt" CSyncEnums::CSYNC_INSTRUCTION_REMOVE OCC::SyncFileItem::Down CSyncEnums::ItemTypeFile

./20210616_1033_owncloud.log.0:2021-06-16 10:35:14:420 [ debug nextcloud.sync.database.sql ]    [ OCC::SqlQuery::bindValue ]:   SQL bind 1 "my_lost_file.txt"

./20210616_1033_owncloud.log.0:2021-06-16 10:35:37:170 [ debug nextcloud.sync.statustracker ]   [ OCC::SyncFileStatusTracker::slotAboutToPropagate ]:   Investigating "my_lost_file.txt" OCC::SyncFileItem::NoStatus CSyncEnums::CSYNC_INSTRUCTION_REMOVE

The problem is very frustrating - files are being deleted with no recovery option left…

Any clew what could be the source of the problem and how to fix that?

once the has successfully synced to the server and you have no quota pressure on this user the file should remain pretty long time in the server-side trashbin…

From my observation NC client makes some heavy lifting but from my feeling it doesn’t check all the synced files… in my setup with 50k+ files (most of them cloud-only as VFS placeholder) it becomes quite after 1-2 minutes