Open muchachagrande opened 3 weeks ago
Sounds similiar to https://github.com/nextcloud/server/issues/45654
Yes, as I searched for cron job and filecache I didn't find it.
Additional info: When rebooted the server to stop the running tasks to apply the workaround I observed the following error in the NC log:
Error while running background job OCA\Files\BackgroundJob\ScanFiles
So that's the job that runs for so long... my guess is that the first run after the upgrade generated all the previews and the following runs after that are very slow because of the huge amount of files it generated before.
Have a same issue, after upgrading from NC27 to 29.0.2. Some additional info (relevant for my installation):
oc_filecache
table contains ~2.1M rows.After upgrading to NC29 and waiting few days my oc_filecache
table grown over 8M rows (and over 6GB) and slow down entire MySQL server. I stop the NC server, kill background task process, deleted all content of preview folder and all rows from oc_filecache
related to them (it takes over 10 hours!) and started server again. An next day I see that the preview folder grows again. I disabled background job at all to determine source of issue and wait one week, nothing happened. Then I disabled preview generation for external storage (via admin settings UI) and enabled cron job, and today preview folder grows again (seems to scanning external storage files because I have some errors in log related to external storage files). At this moment my preview folder has only 3k files and over 580k of empty directories! It seems a serious problem for large installations.
⚠️ This issue respects the following points: ⚠️
Bug description
A cron job is triggering a full file scan and generating previews of all the files. As I have an external NAS disk through SMB the amount of files is huge so after the scan that lasted many hours the appdata previews folder is flooded with many, many files and the oc_filecache grows too large. After this initial scan, there is some other job that triggers a query that lasts so long that the CPU is busy for hours. I managed to find out that the query is
My workaround was to temporary disable the crontab to avoid triggering cron jobs and then deleted previews folder and did an occ files:scan-app-data. I had to reboot the server to stop the neverending query before doing these steps. Unfortunately the cron job that scans all files is triggered periodically so this problem happened again and I had to apply the fix again. Now I have temporarily disabled preview generation but I think that a better solution would be not to generate previews massively but only when entering a folder as it worked before upgrading. This problem didn't happen on NC28. It started to happen after upgrade from 28.0.6 to 29.0.1.
Steps to reproduce
There are no steps from my part. All this happens by triggered cron jobs
Expected behavior
There should be no full scans with previews generation at least the administrator ask for a pre-generation. In my server previews were generated on directory access but after upgrading from 28.0.6 to 29.0.1 it started this full scan.
Installation method
Community VM appliance
Nextcloud Server version
29
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Upgraded to a MAJOR version (ex. 22 to 23)
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response