Nextcloud version (eg, 20.0.5): 24.0.4
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04.1 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.52 (Ubuntu)
PHP version (eg, 7.4): 8.1.2
The issue you are facing:
I run three NextCloud instances. All three were running without any problems. I then updated from Ubuntu 20 to Ubuntu 22 and Nextcloud 23 to Nextcloud 24. Since then, all three instances have been crashing at irregular intervals. I have not found a way to provoke the crashes.
As soon as I try to access Nextcloud via an explorer I get the following error message:
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.
The desktop clients will not be able to synchronize either. It helps to restart the server, then everything works again for an indefinite time. I really hope that someone can help me to fix the error. Thank you very much for your time.
Is this the first time you’ve seen this error? (Y/N): Yes
Steps to replicate it:
- Restart the server
- Wait for an indefinite time
- Server crashes
The output of your Nextcloud log in Admin > Logging:
Error PHP Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away at /var/www/html/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php#101
2022-08-17T12:50:10+0200
Fatal webdav Sabre\DAV\Exception\ServiceUnavailable: OC\DB\Exceptions\DbalException: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:10+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:08+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
Error cron Doctrine\DBAL\Exception\ConnectionLost: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
2022-08-17T12:50:07+0200
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'instanceid' => 'XXXXX',
'passwordsalt' => 'XXXXX',
'secret' => 'XXXXX',
'trusted_domains' =>
array (
0 => 'XXXXX',
),
'datadirectory' => '/mnt/data',
'dbtype' => 'mysql',
'version' => '24.0.4.1',
'overwrite.cli.url' => 'XXXXX',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextclouduser',
'dbpassword' => 'XXXXX',
'installed' => true,
'simpleSignUpLink.shown' => false,
'default_phone_region' => 'DE',
'htaccess.RewriteBase' => '/',
'maintenance' => false,
'theme' => '',
'log_type' => 'file',
'logtimezone' => 'Europe/Berlin',
'logfile' => '/var/log/nextcloud/nextcloud.log',
'loglevel' => 2,
'syslog_tag' => 'Nextcloud',
'mail_smtpmode' => 'smtp',
'mail_smtpauth' => 1,
'mail_sendmailmode' => 'smtp',
'mail_smtpsecure' => 'ssl',
'mail_from_address' => 'info',
'mail_domain' => 'XXXXX',
'mail_smtphost' => 'XXXXX',
'mail_smtpport' => '465',
'mail_smtpname' => 'XXXXX',
'mail_smtppassword' => 'XXXXX',
'updater.release.channel' => 'stable',
'app_install_overwrite' =>
array (
0 => 'richdocumentscode',
1 => 'documentserver_community',
2 => 'backup',
),
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'filelocking.enabled' => 'true',
'redis' =>
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.0,
),
'trusted_proxies' =>
array (
0 => 'XXXXX',
),
'overwritehost' => 'XXXXX',
'overwriteprotocol' => 'https',
);
The output of your Apache/nginx/system log in /var/log/____
:
[Wed Aug 17 00:00:02.019309 2022] [mpm_prefork:notice] [pid 182] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 17 00:00:02.019511 2022] [core:notice] [pid 182] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 17 04:32:55.450368 2022] [mpm_prefork:notice] [pid 182] AH00171: Graceful restart requested, doing restart
[Wed Aug 17 04:32:55.512321 2022] [mpm_prefork:notice] [pid 182] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 17 04:32:55.512425 2022] [core:notice] [pid 182] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 17 04:32:59.943258 2022] [mpm_prefork:notice] [pid 182] AH00171: Graceful restart requested, doing restart
[Wed Aug 17 04:32:59.971623 2022] [mpm_prefork:notice] [pid 182] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 17 04:32:59.971636 2022] [core:notice] [pid 182] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 17 12:50:23.910091 2022] [php:error] [pid 10339] [client 113.208.212.54:55210] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Wed Aug 17 14:47:39.679656 2022] [php:error] [pid 9593] [client 113.208.212.54:55248] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection r>
[Wed Aug 17 14:47:39.679655 2022] [php:error] [pid 10335] [client 113.208.212.54:55250] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Wed Aug 17 14:47:39.681821 2022] [php:error] [pid 9595] [client 113.208.212.54:55254] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection r>
[Wed Aug 17 14:47:39.682682 2022] [php:error] [pid 9601] [client 113.208.212.54:55252] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection r>
[Wed Aug 17 18:50:02.192652 2022] [php:error] [pid 9601] [client 113.208.212.54:55352] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection r>
[Wed Aug 17 19:32:07.989746 2022] [php:error] [pid 10335] [client 113.208.212.54:55364] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Wed Aug 17 19:32:08.031265 2022] [php:error] [pid 9595] [client 113.208.212.54:55368] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection r>
[Wed Aug 17 19:32:08.077279 2022] [php:error] [pid 9601] [client 113.208.212.54:55370] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection r>
[Wed Aug 17 21:34:41.336694 2022] [mpm_prefork:notice] [pid 182] AH00171: Graceful restart requested, doing restart
[Wed Aug 17 21:34:41.487447 2022] [mpm_prefork:notice] [pid 182] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 17 21:34:41.487715 2022] [core:notice] [pid 182] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 17 21:34:48.916255 2022] [mpm_prefork:notice] [pid 182] AH00171: Graceful restart requested, doing restart
[Wed Aug 17 21:34:48.955802 2022] [mpm_prefork:notice] [pid 182] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Wed Aug 17 21:34:48.955816 2022] [core:notice] [pid 182] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 17 23:08:38.770310 2022] [php:error] [pid 14057] [client 113.208.212.54:55474] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Wed Aug 17 23:08:38.773378 2022] [php:error] [pid 14059] [client 113.208.212.54:55480] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Wed Aug 17 23:08:38.773411 2022] [php:error] [pid 14055] [client 113.208.212.54:55478] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Wed Aug 17 23:30:19.672928 2022] [php:error] [pid 14057] [client 113.208.212.54:55494] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Wed Aug 17 23:30:19.672936 2022] [php:error] [pid 14056] [client 113.208.212.54:55496] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Wed Aug 17 23:30:21.784795 2022] [php:error] [pid 14059] [client 113.208.212.54:55498] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Wed Aug 17 23:30:21.805900 2022] [php:error] [pid 14055] [client 113.208.212.54:55500] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Wed Aug 17 23:30:21.805905 2022] [php:error] [pid 14058] [client 113.208.212.54:55502] PHP Fatal error: Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection >
[Thu Aug 18 00:00:01.508247 2022] [mpm_prefork:notice] [pid 182] AH00171: Graceful restart requested, doing restart