nextcloud / groupfolders

πŸ“πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Admin-configured folders shared by everyone in a group. https://github.com/nextcloud-releases/groupfolders
https://apps.nextcloud.com/apps/groupfolders
289 stars 87 forks source link

Endless filecache scan #2820

Closed mhzawadi closed 7 months ago

mhzawadi commented 9 months ago

How to use GitHub

Steps to reproduce

  1. Update to v28.0.2 from 27.1.5
  2. wait for cron to start
  3. see that the instance has slowed down

Expected behaviour

the instance should be the same or better performance

Actual behaviour

The instance slows down to almost unusable

Server configuration

Operating system: Debina

Web server: Nginx

Database: 10.5.21-MariaDB-0+deb11u1 - Debian 11

PHP version: 8.3

Nextcloud version: (see Nextcloud admin page) 28.0.2

Group folders version: 16.0.3

Updated from an older Nextcloud/ownCloud or fresh install: update from 27.1.5

Where did you install Nextcloud from: community zip archive

Are you using external storage, if yes which one: local/s3/smb/sftp/... yes S3 for some users

Are you using encryption: yes/no no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/Saml/... no

Client configuration

Browser: Opera One(version: 107.0.5045.15) (x86_64)

Operating system: MacOS 13.6.3 (22G436)

Logs

Web server error log

Web server error log ``` no error logs ```

Nextcloud log (data/nextcloud.log)

Nextcloud log Below log is from killing a query ``` {"reqId":"QgFqIJJorFUEr5VLkX84","level":3,"time":"2024-02-11 20:53:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (class: OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions, arguments: )","userAgent":"--","version":"28.0.2.5","exception":{"Exception":"Doctrine\\DBAL\\Exception\\ConnectionLost","Message":"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":2006,"Trace":[{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1938,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1880,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1105,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":337,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":171,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":919,"function":"get","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":904,"function":"calculateFolderSizeInner","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":856,"function":"calculateFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":868,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":868,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":868,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Updater.php","line":172,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/View.php","line":707,"function":"remove","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/srv/www/horwood-nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":86,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/srv/www/horwood-nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":60,"function":"expireFolder","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/srv/www/horwood-nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":43,"function":"expireAll","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/public/BackgroundJob/Job.php","line":81,"function":"run","class":"OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/srv/www/horwood-nextcloud/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":104,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":2006,"Trace":[{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1098,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":337,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":171,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":919,"function":"get","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":904,"function":"calculateFolderSizeInner","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":856,"function":"calculateFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":868,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":868,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":868,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Updater.php","line":172,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/View.php","line":707,"function":"remove","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/srv/www/horwood-nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":86,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/srv/www/horwood-nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":60,"function":"expireFolder","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/srv/www/horwood-nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":43,"function":"expireAll","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/public/BackgroundJob/Job.php","line":81,"function":"run","class":"OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/srv/www/horwood-nextcloud/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":"HY000","Trace":[{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1098,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":337,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":171,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":919,"function":"get","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":904,"function":"calculateFolderSizeInner","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":856,"function":"calculateFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":868,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":868,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Cache.php","line":868,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/Cache/Updater.php","line":172,"function":"correctFolderSize","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/private/Files/View.php","line":707,"function":"remove","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/srv/www/horwood-nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":86,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/srv/www/horwood-nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":60,"function":"expireFolder","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/srv/www/horwood-nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":43,"function":"expireAll","class":"OCA\\GroupFolders\\Versions\\GroupVersionsExpireManager","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/public/BackgroundJob/Job.php","line":81,"function":"run","class":"OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/srv/www/horwood-nextcloud/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/srv/www/horwood-nextcloud/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/srv/www/horwood-nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}},"message":"Error while running background job (class: OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions, arguments: )","exception":{},"CustomMessage":"Error while running background job (class: OCA\\GroupFolders\\BackgroundJob\\ExpireGroupVersions, arguments: )"}} ```

Browser log

Browser log ``` No error logs ```

Query example

SELECT `filecache`.`fileid`, `storage`, `path`, `path_hash`, `filecache`.`parent`, `filecache`.`name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `etag`, `filecache`.`permissions`, `checksum`, `unencrypted_size`, `metadata_etag`, `creation_time`, `upload_time`, `meta`.`json` AS `meta_json`, `meta`.`sync_token` AS `meta_sync_token` FROM `oc_filecache` `filecache` LEFT JOIN `oc_filecache_extended` `fe` ON `filecache`.`fileid` = `fe`.`fileid` LEFT JOIN `oc_files_metadata` `meta` ON `filecache`.`fileid` = `meta`.`file_id` WHERE (`storage` = 59) AND(`path_hash` = '06a05fcb889f01eb0dcf3bc1e608b1be')
mhzawadi commented 7 months ago

This looks to be fix with the update