Fehler in der Systemkonfiguration nach Update: General error: 2006 MySQL server has gone away

Nextcloud version: 29.0.8
Operating system and version: Shared hosting “All-inkl”
Apache or nginx version:
PHP version: 8.3

The issue you are facing:
Fehler in der Systemkonfiguration nach Update. Komplette Fehlermeldung:

An exception occured while running the setup check: PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php:71 Stack trace:
#0 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php(71): PDO->query('SELECT `appid`,...')
#1 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Connection.php(1101): Doctrine\DBAL\Driver\PDO\Connection->query('SELECT `appid`,...')
#2 /www/htdocs/w00b3793/cloud/lib/private/DB/Connection.php(333): Doctrine\DBAL\Connection->executeQuery('SELECT `appid`,...', Array, Array, NULL)
#3 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(344): OC\DB\Connection->executeQuery('SELECT `appid`,...', Array, Array, NULL)
#4 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(384): Doctrine\DBAL\Query\QueryBuilder->executeQuery()
#5 /www/htdocs/w00b3793/cloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#6 /www/htdocs/w00b3793/cloud/lib/private/DB/QueryBuilder/QueryBuilder.php(293): OC\DB\QueryBuilder\QueryBuilder->execute()
#7 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(1246): OC\DB\QueryBuilder\QueryBuilder->executeQuery()
#8 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(1208): OC\AppConfig->loadConfig(NULL)
#9 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(127): OC\AppConfig->loadConfigAll()
#10 /www/htdocs/w00b3793/cloud/lib/private/AllConfig.php(196): OC\AppConfig->getKeys('bruteForce')
#11 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(120): OC\AllConfig->getAppKeys('bruteForce')
#12 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(200): OC\Security\Bruteforce\Throttler->isBypassListed('95.19.35.146')
#13 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(181): OC\Security\Bruteforce\Throttler->getAttempts('95.19.35.146', '')
#14 /www/htdocs/w00b3793/cloud/apps/settings/lib/SetupChecks/BruteForceThrottler.php(63): OC\Security\Bruteforce\Throttler->showBruteforceWarning('95.19.35.146')
#15 /www/htdocs/w00b3793/cloud/lib/private/SetupCheck/SetupCheckManager.php(51): OCA\Settings\SetupChecks\BruteForceThrottler->run()
#16 /www/htdocs/w00b3793/cloud/apps/settings/lib/Controller/CheckSetupController.php(183): OC\SetupCheck\SetupCheckManager->runAll()
#17 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/Http/Dispatcher.php(232): OCA\Settings\Controller\CheckSetupController->check()
#18 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/Http/Dispatcher.php(138): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Settings\Controller\CheckSetupController), 'check')
#19 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/App.php(184): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Settings\Controller\CheckSetupController), 'check')
#20 /www/htdocs/w00b3793/cloud/lib/private/Route/Router.php(331): OC\AppFramework\App::main('OCA\\Settings\\Co...', 'check', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#21 /www/htdocs/w00b3793/cloud/lib/base.php(1058): OC\Route\Router->match('/settings/ajax/...')
#22 /www/htdocs/w00b3793/cloud/index.php(49): OC::handleRequest()
#23 {main} Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php:28 Stack trace:
#0 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php(76): Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
#1 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Connection.php(1101): Doctrine\DBAL\Driver\PDO\Connection->query('SELECT `appid`,...')
#2 /www/htdocs/w00b3793/cloud/lib/private/DB/Connection.php(333): Doctrine\DBAL\Connection->executeQuery('SELECT `appid`,...', Array, Array, NULL)
#3 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(344): OC\DB\Connection->executeQuery('SELECT `appid`,...', Array, Array, NULL)
#4 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(384): Doctrine\DBAL\Query\QueryBuilder->executeQuery()
#5 /www/htdocs/w00b3793/cloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#6 /www/htdocs/w00b3793/cloud/lib/private/DB/QueryBuilder/QueryBuilder.php(293): OC\DB\QueryBuilder\QueryBuilder->execute()
#7 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(1246): OC\DB\QueryBuilder\QueryBuilder->executeQuery()
#8 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(1208): OC\AppConfig->loadConfig(NULL)
#9 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(127): OC\AppConfig->loadConfigAll()
#10 /www/htdocs/w00b3793/cloud/lib/private/AllConfig.php(196): OC\AppConfig->getKeys('bruteForce')
#11 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(120): OC\AllConfig->getAppKeys('bruteForce')
#12 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(200): OC\Security\Bruteforce\Throttler->isBypassListed('95.19.35.146')
#13 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(181): OC\Security\Bruteforce\Throttler->getAttempts('95.19.35.146', '')
#14 /www/htdocs/w00b3793/cloud/apps/settings/lib/SetupChecks/BruteForceThrottler.php(63): OC\Security\Bruteforce\Throttler->showBruteforceWarning('95.19.35.146')
#15 /www/htdocs/w00b3793/cloud/lib/private/SetupCheck/SetupCheckManager.php(51): OCA\Settings\SetupChecks\BruteForceThrottler->run()
#16 /www/htdocs/w00b3793/cloud/apps/settings/lib/Controller/CheckSetupController.php(183): OC\SetupCheck\SetupCheckManager->runAll()
#17 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/Http/Dispatcher.php(232): OCA\Settings\Controller\CheckSetupController->check()
#18 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/Http/Dispatcher.php(138): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Settings\Controller\CheckSetupController), 'check')
#19 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/App.php(184): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Settings\Controller\CheckSetupController), 'check')
#20 /www/htdocs/w00b3793/cloud/lib/private/Route/Router.php(331): OC\AppFramework\App::main('OCA\\Settings\\Co...', 'check', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#21 /www/htdocs/w00b3793/cloud/lib/base.php(1058): OC\Route\Router->match('/settings/ajax/...')
#22 /www/htdocs/w00b3793/cloud/index.php(49): OC::handleRequest()
#23 {main} Next Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:104 Stack trace:
#0 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Connection.php(1943): Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert(Object(Doctrine\DBAL\Driver\PDO\Exception), Object(Doctrine\DBAL\Query))
#1 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Connection.php(1885): Doctrine\DBAL\Connection->handleDriverException(Object(Doctrine\DBAL\Driver\PDO\Exception), Object(Doctrine\DBAL\Query))
#2 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Connection.php(1106): Doctrine\DBAL\Connection->convertExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\Exception), 'SELECT `appid`,...', Array, Array)
#3 /www/htdocs/w00b3793/cloud/lib/private/DB/Connection.php(333): Doctrine\DBAL\Connection->executeQuery('SELECT `appid`,...', Array, Array, NULL)
#4 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(344): OC\DB\Connection->executeQuery('SELECT `appid`,...', Array, Array, NULL)
#5 /www/htdocs/w00b3793/cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(384): Doctrine\DBAL\Query\QueryBuilder->executeQuery()
#6 /www/htdocs/w00b3793/cloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#7 /www/htdocs/w00b3793/cloud/lib/private/DB/QueryBuilder/QueryBuilder.php(293): OC\DB\QueryBuilder\QueryBuilder->execute()
#8 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(1246): OC\DB\QueryBuilder\QueryBuilder->executeQuery()
#9 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(1208): OC\AppConfig->loadConfig(NULL)
#10 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(127): OC\AppConfig->loadConfigAll()
#11 /www/htdocs/w00b3793/cloud/lib/private/AllConfig.php(196): OC\AppConfig->getKeys('bruteForce')
#12 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(120): OC\AllConfig->getAppKeys('bruteForce')
#13 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(200): OC\Security\Bruteforce\Throttler->isBypassListed('95.19.35.146')
#14 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(181): OC\Security\Bruteforce\Throttler->getAttempts('95.19.35.146', '')
#15 /www/htdocs/w00b3793/cloud/apps/settings/lib/SetupChecks/BruteForceThrottler.php(63): OC\Security\Bruteforce\Throttler->showBruteforceWarning('95.19.35.146')
#16 /www/htdocs/w00b3793/cloud/lib/private/SetupCheck/SetupCheckManager.php(51): OCA\Settings\SetupChecks\BruteForceThrottler->run()
#17 /www/htdocs/w00b3793/cloud/apps/settings/lib/Controller/CheckSetupController.php(183): OC\SetupCheck\SetupCheckManager->runAll()
#18 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/Http/Dispatcher.php(232): OCA\Settings\Controller\CheckSetupController->check()
#19 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/Http/Dispatcher.php(138): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Settings\Controller\CheckSetupController), 'check')
#20 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/App.php(184): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Settings\Controller\CheckSetupController), 'check')
#21 /www/htdocs/w00b3793/cloud/lib/private/Route/Router.php(331): OC\AppFramework\App::main('OCA\\Settings\\Co...', 'check', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#22 /www/htdocs/w00b3793/cloud/lib/base.php(1058): OC\Route\Router->match('/settings/ajax/...')
#23 /www/htdocs/w00b3793/cloud/index.php(49): OC::handleRequest()
#24 {main} Next OC\DB\Exceptions\DbalException: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /www/htdocs/w00b3793/cloud/lib/private/DB/Exceptions/DbalException.php:71 Stack trace:
#0 /www/htdocs/w00b3793/cloud/lib/private/DB/QueryBuilder/QueryBuilder.php(295): OC\DB\Exceptions\DbalException::wrap(Object(Doctrine\DBAL\Exception\ConnectionLost))
#1 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(1246): OC\DB\QueryBuilder\QueryBuilder->executeQuery()
#2 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(1208): OC\AppConfig->loadConfig(NULL)
#3 /www/htdocs/w00b3793/cloud/lib/private/AppConfig.php(127): OC\AppConfig->loadConfigAll()
#4 /www/htdocs/w00b3793/cloud/lib/private/AllConfig.php(196): OC\AppConfig->getKeys('bruteForce')
#5 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(120): OC\AllConfig->getAppKeys('bruteForce')
#6 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(200): OC\Security\Bruteforce\Throttler->isBypassListed('95.19.35.146')
#7 /www/htdocs/w00b3793/cloud/lib/private/Security/Bruteforce/Throttler.php(181): OC\Security\Bruteforce\Throttler->getAttempts('95.19.35.146', '')
#8 /www/htdocs/w00b3793/cloud/apps/settings/lib/SetupChecks/BruteForceThrottler.php(63): OC\Security\Bruteforce\Throttler->showBruteforceWarning('95.19.35.146')
#9 /www/htdocs/w00b3793/cloud/lib/private/SetupCheck/SetupCheckManager.php(51): OCA\Settings\SetupChecks\BruteForceThrottler->run()
#10 /www/htdocs/w00b3793/cloud/apps/settings/lib/Controller/CheckSetupController.php(183): OC\SetupCheck\SetupCheckManager->runAll()
#11 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/Http/Dispatcher.php(232): OCA\Settings\Controller\CheckSetupController->check()
#12 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/Http/Dispatcher.php(138): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Settings\Controller\CheckSetupController), 'check')
#13 /www/htdocs/w00b3793/cloud/lib/private/AppFramework/App.php(184): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Settings\Controller\CheckSetupController), 'check')
#14 /www/htdocs/w00b3793/cloud/lib/private/Route/Router.php(331): OC\AppFramework\App::main('OCA\\Settings\\Co...', 'check', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#15 /www/htdocs/w00b3793/cloud/lib/base.php(1058): OC\Route\Router->match('/settings/ajax/...')
#16 /www/htdocs/w00b3793/cloud/index.php(49): OC::handleRequest()
#17 {main}

Is this the first time you’ve seen this error? (Y/N): N
It happenes for the 3rd time. After the last two updates the error dissapeared after raising the php-memory-limit to 1024M in user.ini

Steps to replicate it:

  1. running update

The output of your Nextcloud log in Admin > Logging:

 DbalException An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Exception running check OCA\Settings\SetupChecks\BruteForceThrottler: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away 

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'XXXX',
  'passwordsalt' => 'XXXX',
  'secret' => 'XXXX',
  'trusted_domains' => 
  array (
    0 => 'XXXX',
  ),
  'datadirectory' => '/www/htdocs/XXXX',
  'dbtype' => 'mysql',
  'version' => '29.0.8.1',
  'overwrite.cli.url' => 'XXXX',
  'dbname' => 'XXXX',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'XXXX',
  'dbpassword' => 'XXXX',
  'installed' => true,
  'logtimezone' => 'Europe/Berlin',
  'tempdirectory' => '/www/htdocs/XXXX',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'noreply',
  'mail_domain' => 'XXXX',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'XXXX',
  'mail_smtpport' => '465',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpname' => 'XXXX',
  'mail_smtppassword' => 'XXXX',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'maintenance_window_start' => 1,
  'app_install_overwrite' => 
  array (
    0 => 'occweb',
  ),
  'default_phone_region' => 'ES',
  'updater.secret' => '$2y$10$9yslb5MMAqVIrmrV.J.G6.0NYab3NpVjoC.eYSaWhAE771BShpzJS',
);

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

not sure where to look for

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

The database goes away, you are doing too much on the database, so it doesn’t finish the job. Not sure if that is a timeout of the db connection, of the db queries running or some resource limitation on the database. Updates are known to make changes to the database that can take some time.

If you have terminal/ssh access, it can be worth trying to run the update command there because some limits do not apply on command line.

Since it updates the main system and many of the apps, you can try to reduce the apps activated during the update. So it just updates the basic part and then activate the apps later again. Then the app codes are updated and also the app data in the database.

You can also try to increase the mysql connection timeout in php. If that is the problem.

If your database usage is limited and you reached all the limits, you could try to run just the database upgrade outside of your setup (migrate just the essential part on a local machine do the upgrade and migrate back). It seems complicated, I haven’t seen a tutorial with just the necessary steps to do it (without migrating all the data).

Thanks for the quick response!

Unfortunately I don’t have terminal/ssh access on my shared hosting.
So I tried to disable all apps which are not absolutely necessary, that does the trick for now.

Thank you!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.