So I run Nextcloud as a container on Unraid. I use MariaDB as my DB. Currently its set to version 11.4 but this issue was also on 10.x.
Since I updated to NC version 29.x onwards Nextcloud boots and runs ok and I can use it but then after a few hours or next day I see the following error in NC logs:
octrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused in /app/www/public/lib/private/DB/Connection.php:233
Stack trace:
#0 /app/www/public/3rdparty/doctrine/dbal/src/Connection.php(453): OC\DB\Connection->connect()
#1 /app/www/public/3rdparty/doctrine/dbal/src/Connection.php(411): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /app/www/public/3rdparty/doctrine/dbal/src/Connection.php(318): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /app/www/public/lib/private/DB/Connection.php(899): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /app/www/public/lib/private/DB/ConnectionAdapter.php(235): OC\DB\Connection->getDatabaseProvider()
#5 /app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php(96): OC\DB\ConnectionAdapter->getDatabaseProvider()
#6 /app/www/public/lib/private/AppConfig.php(1211): OC\DB\QueryBuilder\QueryBuilder->expr()
#7 /app/www/public/lib/private/AppConfig.php(237): OC\AppConfig->loadConfig()
#8 /app/www/public/lib/private/AppConfig.php(1351): OC\AppConfig->searchValues()
#9 /app/www/public/lib/private/App/AppManager.php(126): OC\AppConfig->getValues()
#10 /app/www/public/lib/private/App/AppManager.php(147): OC\App\AppManager->getInstalledAppsValues()
#11 /app/www/public/lib/private/legacy/OC_App.php(191): OC\App\AppManager->getInstalledApps()
#12 /app/www/public/lib/private/AppFramework/Bootstrap/Coordinator.php(48): OC_App::getEnabledApps()
#13 /app/www/public/lib/base.php(657): OC\AppFramework\Bootstrap\Coordinator->runInitialRegistration()
#14 /app/www/public/lib/base.php(1132): OC::init()
#15 /app/www/public/cron.php(24): require_once('...')
#16 {main}
If I restart NC it works again until random amount of time and then breaks.
Other apps running on my DB are unaffected.
Any help?