Support intro
Sorry to hear you’re facing problems. 
The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.
If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.
Getting help
In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.
Before clicking submit: Please check if your query is already addressed via the following resources:
- Official documentation (searchable and regularly updated)
- How to topics and FAQs
- Forum search
(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).
Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can.
The Basics
- Nextcloud Server version (e.g., 29.x.x):
30.0.6.2
- Operating system and version (e.g., Ubuntu 24.04):
Ubuntu 22.04.5 LTS
- Web server and version (e.g, Apache 2.4.25):
Apache/2.4.52 (Ubuntu)
- Reverse proxy and version _(e.g. nginx 1.27.2)
Apache/2.4.52 (Ubuntu)
- PHP version (e.g, 8.3):
8.3.17
- Is this the first time you’ve seen this error? (Yes / No):
yes
- When did this problem seem to first start?
Updated Ubuntu, restarted host. After reboot, NC was not accesible anymore
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
VirtualBox VM
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
no
Summary of the issue you are facing:
After updating the host OS I get “Internal Server Error” when accessing NC via web browser.
In the NC log file, there are two different errors:
"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away"
followed by:
"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory"
Steps to replicate it (hint: details matter!):
- Open NC url in web browser
Log entries
Nextcloud
Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log
located in your data directory). Feel free to use a pastebin/gist service if necessary.
{"reqId":"JiCCseS0U9ftfxs3saf3","level":3,"time":"2025-03-05T02:46:37+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job OCA\\ServerInfo\\Jobs\\UpdateStorageStats (id: 311984, arguments: null)","userAgent":"--","version":"30.0.6.2","exception":
{"Exception":"OC\\DB\\Exceptions\\DbalException","Message":"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":2006,"Trace":[
{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":53,"function":"wrap","class":"OC\\DB\\Exceptions\\DbalException","type":"::"},
{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},
{"file":"/var/www/nextcloud/apps/serverinfo/lib/StorageStatistics.php","line":70,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},
{"file":"/var/www/nextcloud/apps/serverinfo/lib/Jobs/UpdateStorageStats.php","line":31,"function":"updateStorageCounts","class":"OCA\\ServerInfo\\StorageStatistics","type":"->","args":["*** sensitive parameters replaced ***"]},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\ServerInfo\\Jobs\\UpdateStorageStats","type":"->"},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},
{"file":"/var/www/nextcloud/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],
"File":"/var/www/nextcloud/lib/private/DB/Exceptions/DbalException.php","Line":54,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\ConnectionLost","Message":"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":2006,"Trace":[
{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1976,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},
{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1918,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},
{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1111,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},
{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":415,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},
{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},
{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},
{"file":"/var/www/nextcloud/apps/serverinfo/lib/StorageStatistics.php","line":70,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},
{"file":"/var/www/nextcloud/apps/serverinfo/lib/Jobs/UpdateStorageStats.php","line":31,"function":"updateStorageCounts","class":"OCA\\ServerInfo\\StorageStatistics","type":"->","args":["*** sensitive parameters replaced ***"]},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\ServerInfo\\Jobs\\UpdateStorageStats","type":"->"},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},
{"file":"/var/www/nextcloud/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],
"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":105,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":2006,"Trace":[
{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},
{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1104,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},
{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":415,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},
{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},
{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},
{"file":"/var/www/nextcloud/apps/serverinfo/lib/StorageStatistics.php","line":70,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},
{"file":"/var/www/nextcloud/apps/serverinfo/lib/Jobs/UpdateStorageStats.php","line":31,"function":"updateStorageCounts","class":"OCA\\ServerInfo\\StorageStatistics","type":"->","args":["*** sensitive parameters replaced ***"]},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\ServerInfo\\Jobs\\UpdateStorageStats","type":"->"},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},
{"file":"/var/www/nextcloud/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],
"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":24,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":"HY000","Trace":[
{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},
{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1104,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},
{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":415,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},
{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},
{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},
{"file":"/var/www/nextcloud/apps/serverinfo/lib/StorageStatistics.php","line":70,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},
{"file":"/var/www/nextcloud/apps/serverinfo/lib/Jobs/UpdateStorageStats.php","line":31,"function":"updateStorageCounts","class":"OCA\\ServerInfo\\StorageStatistics","type":"->","args":["*** sensitive parameters replaced ***"]},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\ServerInfo\\Jobs\\UpdateStorageStats","type":"->"},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},
{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},
{"file":"/var/www/nextcloud/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}}},
"message":"Error while running background job OCA\\ServerInfo\\Jobs\\UpdateStorageStats (id: 311984, arguments: null)","exception":{},"CustomMessage":"Error while running background job OCA\\ServerInfo\\Jobs\\UpdateStorageStats (id: 311984, arguments: null)"}}
Followed by:
{"reqId":"JiCCseS0U9ftfxs3saf3","level":3,"time":"2025-03-05T02:46:37+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory","userAgent":"--","version":"30.0.6.2","exception":
{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory","Code":2002,"Trace":[
{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1692,"function":"connect","class":"OC\\DB\\Connection","type":"->"},
{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":871,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->"},
{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/Expression/ExpressionBuilder.php","line":321,"function":"quote","class":"Doctrine\\DBAL\\Connection","type":"->"},
{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php","line":406,"function":"literal","class":"Doctrine\\DBAL\\Query\\Expression\\ExpressionBuilder","type":"->"},
{"file":"/var/www/nextcloud/lib/private/BackgroundJob/JobList.php","line":329,"function":"literal","class":"OC\\DB\\QueryBuilder\\ExpressionBuilder\\ExpressionBuilder","type":"->"},
{"file":"/var/www/nextcloud/lib/private/BackgroundJob/JobList.php","line":319,"function":"unlockJob","class":"OC\\BackgroundJob\\JobList","type":"->"},
{"file":"/var/www/nextcloud/cron.php","line":196,"function":"setLastJob","class":"OC\\BackgroundJob\\JobList","type":"->"}],
"File":"/var/www/nextcloud/lib/private/DB/Connection.php","Line":233,
"message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory","exception":{},"CustomMessage":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory"}}
Web server / Reverse Proxy
The output of your Apache/nginx/system log in /var/log/____
:
192.168.3.11 - - [06/Mar/2025:11:20:56 +0100] "GET / HTTP/1.1" 500 740 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
192.168.3.11 - - [06/Mar/2025:11:20:57 +0100] "GET /favicon.ico HTTP/1.1" 500 740 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
Configuration
Nextcloud
The output of occ config:list system
or similar is best, but, if not possible, the contents of your config.php
file from /path/to/nextcloud
is fine (make sure to remove any identifiable information!):
Running any occ command results in an error message:
sudo -u www-data php /var/www/nextcloud/occ config:list system
An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache OC\Memcache\Redis not available for distributed cache (Is the matching PHP module installed and enabled?)
However, Redis is configured and the service is running.
config.php:
<?php
$CONFIG = array (
'instanceid' => 'x',
'passwordsalt' => 'x',
'secret' => 'x',
'trusted_domains' =>
array (
0 => 'xxx.xxx.com',
1 => 'xxx.xxx.xxx.xxx',
2 => '127.0.0.1',
3 => '192.168.0.101',
4 => '192.168.3.11',
),
'trusted_proxies' =>
array (
0 => '192.168.3.11',
),
'datadirectory' => '/var/www/nextcloud/data',
'dbtype' => 'mysql',
'version' => '30.0.6.2',
'overwrite.cli.url' => 'https://xxx.xxx.com',
'dbname' => 'nextcloud',
'dbhost' => '127.0.0.1',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'nextcloud',
'dbpassword' => 'abc123',
'installed' => true,
'maintenance' => false,
'theme' => '',
'log_type' => 'file',
'logfile' => '/var/log/nextcloud.log',
'loglevel' => '2',
'log_rotate_size' => 104857600,
'overwritehost' => 'xxx.xxx.com',
'overwriteprotocol' => 'https',
'overwritecondaddr' => '^192\\.168\\.3\\.11$',
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '127.0.0.1',
'port' => 6379,
),
'app_install_overwrite' =>
array (
0 => 'mindmap_app',
1 => 'folderplayer',
),
'mysql.utf8mb4' => true,
'default_phone_region' => 'ISO 3166-2:NO',
'maintenance_window_start' => 1,
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'ssl',
'mail_sendmailmode' => 'smtp',
'mail_from_address' => 'xxx',
'mail_domain' => 'gmail.com',
'mail_smtphost' => 'smtp.gmail.com',
'mail_smtpport' => '465',
'mail_smtpauth' => 1,
'mail_smtpname' => 'xxx',
'mail_smtppassword' => 'xxx',
'memories.db.triggers.fcu' => true,
'memories.exiftool' => '/var/www/nextcloud/apps/memories/bin-ext/exiftool-amd64-glibc',
'memories.vod.path' => '/var/www/nextcloud/apps/memories/bin-ext/go-vod-amd64',
'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
'memories.vod.ffprobe' => '/usr/bin/ffprobe',
);
NC worked fine until the host OS update/reboot.
- I read quite some posts on the database errors but any suggested solution did not work for me.
- I checked the apache2 and mariadb services; they seem to work normally
- I am able to run
mysql
and run theUSE nextcloud;
command - accessing the database works.
So I am running out of ideas - any help would be appreciated!