High CPU Load from MySQL causing from a strange Query

Hello everyone,

since two days my VM eats up all of my CPU Power because of this weird issue:Ö

Nextcloud version: 14.0.3
Operating system and version: Debian 9.5
Apache or nginx version: Apache/2.4.25
PHP version: 7.0

The issue you are facing: High CPU Load caused by SQL Server

Is this the first time you’ve seen this error?: Y

Steps to replicate it:

  1. Start Server, instant high load

The output of your Nextcloud log in Admin > Logging:

Fatal	webdav	Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT * FROM `oc_properties` WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` in (?)' with params ["Gamienator", "files\/Gamienator\/Pi_Backup\/dc\/dc.gamie.local\/dc.gamie.local-rsync-backup-20181117-043001\/var\/lib\/dpkg\/info\/javascript-common.prerm", "{http:\/\/apache.org\/dav\/props\/}executable"]: SQLSTATE[08S01]: Communication link failure: 1053 Server shutdown in progress	2018-11-22T07:41:21+0100

The output of your Apache/nginx/system log in /var/log/____:

[Thu Nov 22 07:41:22.979873 2018] [:error] [pid 10062] [client 88.153.61.237:39504] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/html/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/html/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Drive in /var/www/html/lib/private/DB/Connection.php on line 64

So by creating this Ticket I might have a clue whats going on. On my home there are two Raspberry PIs thats accessing the Cloud via WebDAV. Maybe thats the ready whats going on? On the MySQL Process List ist the following going on:

| 50057 | cloud | localhost | cloud | Query   |    0 | Sending data | SELECT * FROM `oc_properties` WHERE `userid` = 'Gamienator' AND `propertypath` = 'files/Gamienator/P |    0.000 |
| 50068 | cloud | localhost | cloud | Query   |    0 | Sending data | SELECT * FROM `oc_properties` WHERE `userid` = 'Gamienator' AND `propertypath` = 'files/Gamienator/P |    0.000 |
| 50092 | cloud | localhost | cloud | Query   |    0 | Sending data | SELECT * FROM `oc_properties` WHERE `userid` = 'Gamienator' AND `propertypath` = 'files/Gamienator/P |    0.000 |
| 50109 | cloud | localhost | cloud | Query   |    0 | Sending data | SELECT * FROM `oc_properties` WHERE `userid` = 'Gamienator' AND `propertypath` = 'files/Gamienator/P |    0.000 |
| 50124 | cloud | localhost | cloud | Query   |    0 | Sending data | SELECT * FROM `oc_properties` WHERE `userid` = 'Gamienator' AND `propertypath` = 'files/Gamienator/P |    0.000 |
| 50137 | cloud | localhost | cloud | Query   |    0 | Sending data | SELECT * FROM `oc_properties` WHERE `userid` = 'Gamienator' AND `propertypath` = 'files/Gamienator/P |    0.000 |

So does any have an idea how can I check whats exaxtly going on?

Thanks anyone for the help!

1 Like