SQL database broken due to Network Attached storage issue

Hi there,

So I got a failure of my nextcloud server yesterday and I was trying to get in back but it seems that I cannot , and I am a bit lost troubleshooting this

A bit of background

Nextcloud v22
Server : Debian Buster  VPS
1 GB RAM , 1 vCPU , 15 GB vdisk

Trying to access the webgui I get this

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

I think the error came from using rclone , the story behind is that I’m using some extra storage from network connected drives using rclone.
Syncing some files looks like I exceeded the limit for the google api

Aug 03 11:11:30 servituro rclone[676]: 2021/08/03 11:11:30 ERROR : live/music/2006 - Movies Scenes Vol 1-2/23-madlib_the_beat_konducta-money_hugger_(gold    _diggin)-ftd.mp3.ocTransferId1181630799.part: WriteFileHandle.New Rcat failed: googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded

So this created a snowball effect with an I/O issue with the kernel that I couldn’t really stop apache2 neither kill the processes that were originated
I had to Stop rclone services , then apache2 got freed , and I came back to start again my nextcloud instance , but if I access through the web GUI I come across the following error.

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Which takes me to the log

/var/www/html/nextcloudlocal/data/nextcloud.log
(Im not gonna paste the whole log but its full of errors of the same typology)

 {"reqId":"xQ7YgWtbAdgmihXhhDHV","level":3,"time":"2021-08-03T16:19:45+00:00","remoteAddr":"10.8.0.6","user":"fakuve","app":"PHP","method":"PROPFIND","url":"/nextcloudlocal/remote.php/dav/files/fakuve/projectsreco/live/projects/jamming-kealstropo-AD%20Project/Samples","message":"Error while sending QUERY packet. PID=3478 at /var/www/html/nextcloudlocal/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php#82","userAgent":"Mozilla/5.0 (Windows) mirall/3.2.4stable-Win64 (build 20210706) (Nextcloud, windows-10.0.18363 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"22.0.0.11","exception":{"Exception":"Error","Message":"Error while sending QUERY packet. PID=3478 at /var/www/html/nextcloudlocal/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php#82","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"Error while sending QUERY packet. PID=3478","/var/www/html/nextcloudlocal/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",82,{"params":null}]},{"file":"/var/www/html/nextcloudlocal/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":82,"function":"execute","class":"PDOStatement","type":"->","args":[null]},{"file":"/var/www/html/nextcloudlocal/3rdparty/doctrine/dbal/src/Connection.php","line":1030,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[]},{"file":"/var/www/html/nextcloudlocal/lib/private/DB/Connection.php","line":231,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT `uid`, `displayname` FROM `oc_users` WHERE `uid_lower` = ?",["fakuve"],[2],null]},{"file":"/var/www/html/nextcloudlocal/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":210,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT `uid`, `displayname` FROM `oc_users` WHERE `uid_lower` = :dcValue1",{"dcValue1":"fakuve"},{"dcValue1":2}]},{"file":"/var/www/html/nextcloudlocal/lib/private/DB/QueryBuilder/QueryBuilder.php","line":287,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/nextcloudlocal/lib/private/User/Database.php","line":385,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/nextcloudlocal/lib/private/User/Database.php","line":429,"function":"loadUser","class":"OC\\User\\Database","type":"->","args":["fakuve"]},{"file":"/var/www/html/nextcloudlocal/lib/private/User/Manager.php","line":176,"function":"userExists","class":"OC\\User\\Database","type":"->","args":["fakuve"]},{"file":"/var/www/html/nextcloudlocal/lib/private/User/Session.php","line":239,"function":"get","class":"OC\\User\\Manager","type":"->","args":["fakuve"]},{"file":"/var/www/html/nextcloudlocal/lib/private/legacy/OC_App.php","line":388,"function":"getUser","class":"OC\\User\\Session","type":"->","args":[]},{"file":"/var/www/html/nextcloudlocal/lib/private/legacy/OC_App.php","line":121,"function":"getEnabledApps","class":"OC_App","type":"::","args":[]},{"file":"/var/www/html/nextcloudlocal/lib/private/legacy/OC_User.php","line":125,"function":"loadApps","class":"OC_App","type":"::","args":[["prelogin"]]},{"file":"/var/www/html/nextcloudlocal/lib/base.php","line":713,"function":"setupBackends","class":"OC_User","type":"::","args":[]},{"file":"/var/www/html/nextcloudlocal/lib/base.php","line":1083,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/nextcloudlocal/remote.php","line":114,"args":["/var/www/html/nextcloudlocal/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/nextcloudlocal/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}                                                                          {"reqId":"xQ7YgWtbAdgmihXhhDHV","level":4,"time":"2021-08-03T16:19:45+00:00","remoteAddr":"10.8.0.6","user":"fakuve","app":"webdav","method":"PROPFIND","url":"/nextcloudlocal/remote.php/dav/files/fakuve/projectsreco/live/projects/jamming-kealstropo-AD%20Project/Samples","message":"Doctrine\\DBAL\\Exception\\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","userAgent":"Mozilla/5.0 (Windows) mirall/3.2.4stable-Win64 (build 20210706) (Nextcloud, windows-10.0.18363 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"22.0.0.11","exception":{"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Message":"Doctrine\\DBAL\\Exception\\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":0,"Trace":[{"file":"/var/www/html/nextcloudlocal/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"{closure}","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloudlocal/3rdparty/sabre/dav/lib/DAV/Server.php","line":456,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["beforeMethod:PROPFIND",["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]]},{"file":"/var/www/html/nextcloudlocal/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/var/www/html/nextcloudlocal/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/nextcloudlocal/remote.php","line":75,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/nextcloudlocal/remote.php","line":168,"function":"handleException","args":[{"__class__":"Doctrine\\DBAL\\Exception\\ConnectionLost"}]}],"File":"/var/www/html/nextcloudlocal/remote.php","Line":73,"CustomMessage":"--"}}

And here I am stuck in here.
I guess I need to fix the SQL database , but I dont know where to start from. Any ideas?

Thanks!!

Ok so I got it fixed.
I’m not quite sure how this happened , but it may have been that I reseted the VPS . Not sure exactly , but it is working.
Thank you