Nextcloud Filecache on local read-only Storage

Nextcloud version: 22.2.5
Operating system and version: Ubuntu 20.04
Apache or nginx version: 2.4.41
PHP version: 7.4.3

An application is storing and deleting files and folders on a local path /store/Application/

I added this path as an external storage (local) as admin and gave access rights to my normal user.

These files and folders needs to be accessed by the mobile app (Android).

When files and folders are added by the application, I can see them in the App.
When files and folders are deleted by the application, the deleted files and folders are still showing up in the app and in the webui.

After running these two commands the deleted folders under /store/Application/ are still showing up:

sudo -u www-data php /var/www/ssl/nc/occ files:scan --all

sudo -u www-data php /var/www/ssl/nc/occ files:cleanup

I also checked the mysql table oc_filecache: Deleted files are still in the table.

  • When I click on one deleted folder in the webui, all deleted files and folders disappear and the webui/app are not showing the deleted files and folders anymore. Also the entries in oc_filecache table are gone.

  • When I click on one deleted folder in the android app, just this deleted folder disappears, but not the others.

My plan was to start every night a job to rescan the files, but the app and webui are still showing the deleted files and folders until I try to access a deleted folder.

Does anyone has an idea how to achieve this? Login to the webui and click on a deleted folder is not an option. By just using the android app I would have to tap on every deleted folder under /store/Application/…

Thanks a lot in advance