Internal Server Error / An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Encountering an internal server error. The above mentioned log “An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away” has been copied from /var/log/apache2/error.log. After a lot off fiddeling around and upgrading php8.1 → 8.2 to solve the issue, several restarts, etc. the logfile is empty.

No chance to upgrade NCP or NC to a newer version, because “Nextcloud is down”.

Furhter description below.

Thank you very much in advance.


Nextcloud version (eg, 20.0.5): 27.1.3.2
Operating system and version (eg, Ubuntu 20.04): Debian 11 (NextcloudPi)
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.56
PHP version (eg, 7.4): 8.2

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Try to connect via e.g. via browser
  2. See Internal Server Error

The output of your Nextcloud log in Admin > Logging:


> {"reqId":"343ESy9XxOm0ZeRz2oBj","level":1,"time":"2023-10-29T12:08:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::incompatibleAppDisabled: Disabled incompatible app: polls","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":1,"time":"2023-10-29T12:08:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::incompatibleAppDisabled: Disabled incompatible app: richdocuments","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":1,"time":"2023-10-29T12:08:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::incompatibleAppDisabled: Disabled incompatible app: tasks","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreAppBefore: Checking for update of app \"activity\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreApp: Checked for update of app \"activity\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreAppBefore: Checking for update of app \"bruteforcesettings\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreApp: Checked for update of app \"bruteforcesettings\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreAppBefore: Checking for update of app \"cloud_federation_api\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreApp: Checked for update of app \"cloud_federation_api\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreAppBefore: Checking for update of app \"comments\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreApp: Checked for update of app \"comments\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreAppBefore: Checking for update of app \"contactsinteraction\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreApp: Checked for update of app \"contactsinteraction\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreAppBefore: Checking for update of app \"dashboard\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreApp: Checked for update of app \"dashboard\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreAppBefore: Checking for update of app \"dav\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreApp: Checked for update of app \"dav\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreAppBefore: Checking for update of app \"federatedfilesharing\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreApp: Checked for update of app \"federatedfilesharing\" in appstore","userAgent":"--","version":"27.0.1.2","data":{"app":"updater"}}
{"reqId":"343ESy9XxOm0ZeRz2oBj","level":0,"time":"2023-10-29T12:08:44+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::chnextcloud.log

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


> <?php
$CONFIG = array (
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    11 => '2003:c1:af20:1800:4a85:3db4:6137:fbe5',
    1 => '192.168.178.50',
    5 => 'nextcloudpi.local',
    7 => 'nextcloudpi',
    8 => 'nextcloudpi.lan',
    20 => 'xxx',
    22 => 'xxx',
    23 => 'xxx',
    '' => 'nextcloudpi',
    3 => 'nextcloudpi',
    14 => 'nextcloudpi',
    21 => 'xxx',
  ),
  'datadirectory' => '/media/myCloudDrive/ncdata',
  'dbtype' => 'mysql',
  'version' => '27.1.3.2',
  'overwrite.cli.url' => 'https://nextcloudpi/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => 'xxx',
  'installed' => true,
  'instanceid' => 'ocrwufnn7knt',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '9eVVdr/J/8uhI4xO0b6+lyQcjwcmieahDFnjOIeU+dg=',
  ),
  'tempdirectory' => '/media/myCloudDrive/ncdata/tmp',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'xxx',
  'mail_domain' => 'xxx',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'logfile' => '/media/myCloudDrive/ncdata/nextcloud.log',
  'loglevel' => '2',
  'log_type' => 'file',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'xxx',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'app_install_overwrite' =>
  array (
    0 => 'admin_notifications',
    1 => 'social',
    2 => 'nextcloudpi',
  ),
  'theme' => '',
  'skeletondirectory' => '',
  'default_phone_region' => 'DE',
  'trusted_proxies' =>
  array (
    11 => '127.0.0.1',
    12 => '::1',
    13 => 'nextcloudpi',
    14 => '192.168.178.50',
  ),
  'htaccess.RewriteBase' => '/',
);

The output of your Apache/nginx/system log in /var/log/apache2/nc-error.log:


> [Thu Nov 30 20:57:10.533644 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'
[Thu Nov 30 20:57:10.555099 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'
[Thu Nov 30 20:57:10.582047 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'
[Thu Nov 30 20:57:10.609676 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'
[Thu Nov 30 20:57:10.634787 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'
[Thu Nov 30 20:57:10.658789 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'
[Thu Nov 30 20:57:10.680087 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'
[Thu Nov 30 20:57:10.709305 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'
[Thu Nov 30 20:57:10.728129 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'
[Thu Nov 30 20:57:10.750875 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'
[Thu Nov 30 21:10:06.492669 2023] [proxy_fcgi:error] [pid 2364] [client 79.245.22.130:52398] AH01071: Got error 'Access to the script 'redirect:/index.php/v2/notifications' has been denied (see security.limit_extensions)'

The output of ncp.log file in /var/log/ncp.log:

> +++ [[ aarch64[ nc-limits ] (Thu 30 Nov 2023 09:10:25 PM CET)
+ configure
++ get_total_mem
+++ free -b
+++ sed -n 2p
+++ awk '{ print $2 }'
++ local total_mem=3968856064
++ local MAX_32BIT=4096000000
++ [[ aarch64 == \a\r\m\v\7 ]]
++ echo 3968856064
+ local TOTAL_MEM=3968856064
+ file /bin/bash
+ grep 64-bit
+ local AUTOMEM=2976642048
+ local require_fpm_restart=false
+ local CONF=/etc/php/8.1/fpm/conf.d/90-ncp.ini
++ cat /etc/php/8.1/fpm/conf.d/90-ncp.ini
+ local 'CONF_VALUE=; disable .user.ini files for performance and workaround NC update bugs
user_ini.filename =

; from Nextcloud .user.ini
upload_max_filesize=10G
post_max_size=10G
memory_limit=2976642048
mbstring.func_overload=0
always_populate_raw_post_data=-1
default_charset='\''UTF-8'\''
output_buffering=0

; slow transfers will be killed after this time
max_execution_time=3600
max_input_time=3600'
++ tmpl_php_max_memory
+++ get_total_mem
++++ free -b
++++ sed -n 2p
++++ awk '{ print $2 }'
+++ local total_mem=3968856064
+++ local MAX_32BIT=4096000000
+++ [[ aarch64 == \a\r\m\v\7 ]]
+++ echo 3968856064
++ local TOTAL_MEM=3968856064
+++ find_app_param nc-limits MEMORYLIMIT
+++ local script=nc-limits
+++ local param_id=MEMORYLIMIT
++++ basename nc-limits .sh
+++ local ncp_app=nc-limits
+++ local cfg_file=/usr/local/etc/ncp-config.d/nc-limits.cfg
++++ find_app_param_num nc-limits MEMORYLIMIT
++++ local script=nc-limits
++++ local param_id=MEMORYLIMIT
+++++ basename nc-limits .sh
++++ local ncp_app=nc-limits
++++ local cfg_file=/usr/local/etc/ncp-config.d/nc-limits.cfg
++++ [[ -f /usr/local/etc/ncp-config.d/nc-limits.cfg ]]
+++++ cat /usr/local/etc/ncp-config.d/nc-limits.cfg
++++ local 'cfg={
  "id": "nc-limits",
  "name": "Nc-limits",
  "title": "nc-limits",
  "description": "Configure system limits for NextcloudPi",
  "info": "Examples: 200M or 2G. Write 0 for autoconfig",
  "infotitle": "",
  "params": [
    {
      "id": "MAXFILESIZE",
      "name": "Maximum file size",
      "value": "10G",
      "default": "10G",
      "suggest": "10G"
    },
    {
      "id": "MEMORYLIMIT",
      "name": "Memory limit",
      "value": "0",
      "default": "0",
      "suggest": "0"
    },
    {
      "id": "PHPTHREADS",
      "name": "PHP threads",
      "value": "0",
      "default": "0",
      "suggest": "0"

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.

No logs available

I found the nextcloud logs.

{“reqId”:“nVXyz0dxllmssfyTlRxT”,“level”:4,“time”:“2023-11-28T17:44:04+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“PkFYofOJ8Ctt9bBfW3xd”,“level”:4,“time”:“2023-11-28T18:00:27+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“jReTyfhT6HzXc8MOFxmJ”,“level”:4,“time”:“2023-11-28T18:11:31+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“xMdNQTuSFk9ruqLCYTKL”,“level”:4,“time”:“2023-11-28T18:16:50+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“69ar1TgsRkGajJ0gmTTE”,“level”:4,“time”:“2023-11-28T18:18:36+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“ljDko2DgedDWc4YNUh15”,“level”:4,“time”:“2023-11-28T18:28:48+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“pdPnXWKHTUdRznPRTZ11”,“level”:4,“time”:“2023-11-28T18:30:35+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“ZGcYi9KaqklF4Hlvw8UL”,“level”:4,“time”:“2023-11-28T18:38:06+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“LdAjYUFuAgnqfggIKyly”,“level”:4,“time”:“2023-11-28T19:00:42+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“q5NHokXKZn27RHvHewtC”,“level”:4,“time”:“2023-11-28T19:04:40+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“QFpD3709PsXI2WCgNqJX”,“level”:4,“time”:“2023-11-28T19:10:52+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”>{“reqId”:“ZWY8RGJRo4vb5olWICkwFwAAAAE”,“level”:4,“time”:“2023-11-28T19:15:16+00:00”,“remoteAddr”:“79.245.16.57”,“user”:“–”,“app”:“no app in context”,“method”:“PROPFIND”,“url”:“/remote.php/dav/addressbooks/users/Aircan/contacts/”,“message”:“Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General e>{“reqId”:“ZWY8RGJRo4vb5olWICkwFwAAAAE”,“level”:3,“time”:“2023-11-28T19:15:16+00:00”,“remoteAddr”:“79.245.16.57”,“user”:”–“,“app”:“no app in context”,“method”:“PROPFIND”,“url”:”/remote.php/dav/addressbooks/users/Aircan/contacts/“,“message”:“Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connectio>{“reqId”:“ZWY8RGJRo4vb5olWICkwFwAAAAE”,“level”:3,“time”:“2023-11-28T19:15:16+00:00”,“remoteAddr”:“79.245.16.57”,“user”:”–”,“app”:“webdav”,“method”:“PROPFIND”,“url”:“/remote.php/dav/addressbooks/users/Aircan/contacts/”,“message”:“OC\DB\Exceptions\DbalException: Failed to connect to the database: An exception occurred in the driver: SQLSTATE>{“reqId”:“6PboXtWdXEuXH3K2jtVh”,“level”:3,“time”:“2023-11-29T00:25:02+00:00”,“remoteAddr”:”“,“user”:”–“,“app”:“cron”,“method”:”“,“url”:”–“,“message”:“Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused”,“userAgent”:”–“,“version”:“27.1.3.2”,“exception”:{“Exception”:“Doctrine\DBAL>{“reqId”:“ZWe9qTVLZ5JrprXGL3tCkwAAAAA”,“level”:3,“time”:“2023-11-29T22:39:37+00:00”,“remoteAddr”:“192.168.178.10”,“user”:”–”,“app”:“index”,“method”:“GET”,“url”:“/index.php/204”,“message”:“An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“Mozilla/5.0 (Windows) mirall/3.>{“reqId”:“ZWfIzRMWzyFD2Skpm2Xb_gAAAAA”,“level”:3,“time”:“2023-11-29T23:27:10+00:00”,“remoteAddr”:“192.168.178.10”,“user”:”–“,“app”:“index”,“method”:“GET”,“url”:”/index.php/204",“message”:“An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“Mozilla/5.0 (Windows) mirall/3.>{“reqId”:“ZWfJh2v_HO3b8WK4PXav5gAAAAQ”,“level”:3,“time”:“2023-11-29T23:30:16+00:00”,“remoteAddr”:“192.168.178.10”,“user”:”–“,“app”:“index”,“method”:“GET”,“url”:”/index.php/204",“message”:“An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“Mozilla/5.0 (Windows) mirall/3.>{“reqId”:“ZWfKQSA4SxWc_vkE2vM7iwAAAAI”,“level”:3,“time”:“2023-11-29T23:33:22+00:00”,“remoteAddr”:“192.168.178.10”,“user”:”–“,“app”:“index”,“method”:“GET”,“url”:”/index.php/204",“message”:“An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“Mozilla/5.0 (Windows) mirall/3.>{“reqId”:“ZWfk5q8h0Nui85a4aNrAPgAAAAY”,“level”:3,“time”:“2023-11-30T01:27:02+00:00”,“remoteAddr”:“192.168.178.10”,“user”:”–“,“app”:“index”,“method”:“GET”,“url”:”/index.php/204",“message”:“An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“Mozilla/5.0 (Windows) mirall/3.>{“reqId”:“ZNHTWQSQBHGyfnc0FxTd”,“level”:3,“time”:“2023-11-30T02:40:02+00:00”,“remoteAddr”:”“,“user”:”–“,“app”:“cron”,“method”:”“,“url”:”–“,“message”:“An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:”–“,“version”:“27.1.3.2”,“exception”:{“Exception”:“Doctrine\DBAL\E>{“reqId”:“ZWg9TtMUQBaQP06noY81pgAAAAI”,“level”:3,“time”:“2023-11-30T07:44:15+00:00”,“remoteAddr”:“192.168.178.10”,“user”:”–”,“app”:“index”,“method”:“GET”,“url”:“/index.php/204”,“message”:“An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“Mozilla/5.0 (Windows) mirall/3.>{“reqId”:“ZWhIsMfW20sDlHjSEbt1PwAAAAA”,“level”:3,“time”:“2023-11-30T08:32:49+00:00”,“remoteAddr”:“192.168.178.10”,“user”:”–“,“app”:“index”,“method”:“GET”,“url”:”/index.php/204",“message”:“An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“Mozilla/5.0 (Windows) mirall/3.>{“reqId”:“cgR0iV0S8yjEUgRLf4rQ”,“level”:3,“time”:“2023-11-30T22:10:02+00:00”,“remoteAddr”:”“,“user”:”–“,“app”:“cron”,“method”:”“,“url”:”–“,“message”:“An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:”–“,“version”:“27.1.3.2”,“exception”:{“Exception”:“Doctrine\DBAL\E>{“reqId”:“cRIbKgAHJKJvpCH8w0gA”,“level”:3,“time”:“2023-12-01T16:35:02+00:00”,“remoteAddr”:””,“user”:“–”,“app”:“cron”,“method”:“”,“url”:“–”,“message”:“An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“userAgent”:“–”,“version”:“27.1.3.2”,“exception”:{“Exception”:"Doctrine\DBAL\E>

In addition I tried

sudo -u www-data php occ maintenance:repair

An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused in /var/www/nextcloud/lib/private/DB/Connection.php:140
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1029): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(262): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(418): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(184): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(374): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(803): OC\AppConfig->getValues()
#9 /var/www/nextcloud/lib/private/Server.php(736): OC_App::getAppVersions()
#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#13 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(193): OC\AppFramework\Utility\SimpleContainer->get()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#19 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#21 /var/www/nextcloud/lib/private/Server.php(1130): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#25 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#27 /var/www/nextcloud/lib/private/Server.php(2088): OC\AppFramework\Utility\SimpleContainer->get()
#28 /var/www/nextcloud/lib/private/Files/View.php(107): OC\Server->getLockingProvider()
#29 /var/www/nextcloud/lib/private/Server.php(470): OC\Files\View->__construct()
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#33 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#35 /var/www/nextcloud/lib/private/Server.php(1490): OC\AppFramework\Utility\SimpleContainer->get()
#36 /var/www/nextcloud/lib/base.php(635): OC\Server->boot()
#37 /var/www/nextcloud/lib/base.php(1196): OC::init()
#38 /var/www/nextcloud/console.php(48): require_once(‘…’)
#39 /var/www/nextcloud/occ(11): require_once(‘…’)

NextCloudPi v1.53.0 supports, works and comes with with PHP 8.1.18

After restoring a 4 week old backup the issue still exists with NCP 1.53.0 and php 8.1.25

Have you cleared the op-cache? There is an app inside the ncp-gui/tui

@REAPERSbattlecry How to do that?

Hi,

In case you havn’t done it, can you please restart only mysql and check it? I’ve had this one time that the order of the services to be started generated this error.

some like:
sudo systemctl restart mysqld

VG

Error still exists after running the suggested command.

systemctl status mariadb

delivers:

mariadb.service - MariaDB 10.6.16 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
             └─migrated-from-my.cnf-settings.conf, ncp-delay-automount.conf
     Active: activating (start-pre) since Sun 2024-01-21 14:21:46 CET; 17s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 16811 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 16812 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 16814 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-e>
Cntrl PID: 16894 (sleep)
      Tasks: 1 (limit: 4206)
     Memory: 176.0K
        CPU: 224ms
     CGroup: /system.slice/mariadb.service
             └─16894 /bin/sleep 20

Jan 21 14:21:46 nextcloudpi systemd[1]: Starting MariaDB 10.6.16 database server...

So, obviously, the DB server does not start.
How to fix or further proceed/investigate?

I also tried to upgrade NCP which delivered:

An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection timed out in /var/www/nextcloud/lib/private/DB/Connection.php:140
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1029): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(262): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(418): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(184): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(374): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(803): OC\AppConfig->getValues()
#9 /var/www/nextcloud/lib/private/Server.php(736): OC_App::getAppVersions()
#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC\{closure}()
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#13 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(193): OC\AppFramework\Utility\SimpleContainer->get()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#19 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#21 /var/www/nextcloud/lib/private/Server.php(1130): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC\{closure}()
#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#25 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#27 /var/www/nextcloud/lib/private/Server.php(2088): OC\AppFramework\Utility\SimpleContainer->get()
#28 /var/www/nextcloud/lib/private/Files/View.php(107): OC\Server->getLockingProvider()
#29 /var/www/nextcloud/lib/private/Server.php(470): OC\Files\View->__construct()
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC\{closure}()
#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#33 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#35 /var/www/nextcloud/lib/private/Server.php(1490): OC\AppFramework\Utility\SimpleContainer->get()
#36 /var/www/nextcloud/lib/base.php(635): OC\Server->boot()
#37 /var/www/nextcloud/lib/base.php(1196): OC::init()
#38 /var/www/nextcloud/console.php(48): require_once('...')
#39 /var/www/nextcloud/occ(11): require_once('...')
#40 {main}

@sambilanet

Hi,

did you replace localhost with 127.0.0.1 in your config file like here already sugested?:

‘dbhost’ => ‘127.0.0.1’,

I guess you have to resolve your database problem first.

@sambilanet
Yes, I already did change the dbhost.
And agreed, the DB problem needs to be solved and most likely the other one is fixed on the way.

Do you have an idea how to fix the db issue?

Please confirm that you have changed the config file not the DB ?

I have changed the ‘dbhost’ => ‘127.0.0.1’, string in /var/www/nextcloud/config/config.php

Investigation over the last 3 hours further made me unsure, whether I changed the db location (I set this up years ago).
Might be /var/lib/mysql or /media/myCloudDrive/ncdatabase.
Maybe some config is just pointing to the wrong directory.

edit: @sambilanet with ls -lsah I found that the files in the latter directory have been touched last time on Mar 2020. So this does not seem to be the right db directory. But the one /var/lib/mysql, as seen in NCP Admin UI.

Btw. NCP Admin UI works, but NC UI not. And all the webdav sync does not work, either.

ok, one step by the other :slight_smile:
This exuted in $/etc/mysql should give you a path:

sudo grep -r datadir

/var/lib/mysql might be the answer.
Please confirm.

PS Please make sure we don’t mix up datadirectory in nextcloud config with the datadirectory for the database.

Output:

mariadb.conf.d/90-ncp.cnf:datadir = /var/lib/mysql
mariadb.conf.d/50-server.cnf:#datadir                 = /var/lib/mysql

@sambilanet

There are no MariaDB related logs available. So I went with journalctl -u mariadb -f which resulted in:

Jan 21 15:40:01 nextcloudpi systemd[1]: Starting MariaDB 10.6.16 database server...
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] Starting MariaDB 10.6.16-MariaDB-1:10.6.16+maria~deb11 source revision b83c379420a8846ae4b28768d3c81fa354cca056 as process 18090
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Number of pools: 1
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Using ARMv8 crc32 + pmull instructions
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Using liburing
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Initializing buffer pool, total size = 1073741824, chunk size = 134217728
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Completed initialization of buffer pool
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=63209452151,63209452151
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 2 row operations to undo
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Trx id counter is 63341608
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: To recover: 376 pages
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: 128 rollback segments are active.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Starting in background the rollback of recovered transactions
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Creating shared tablespace for temporary tables
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: 10.6.16 started; log sequence number 63213850036; transaction id 63341609
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] Plugin 'FEEDBACK' is disabled.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Warning] 'innodb-large-prefix' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Warning] 'innodb-file-format' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Warning] 'innodb-buffer-pool-instances' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Warning] InnoDB: Record in index `fs_id_storage_size` of table `nextcloud`.`oc_filecache` was not found on rollback, trying to insert: TUPLE (info_bits=0, 3 fields): {[8]      $ (0x80000000000024FA),[8]        (0x8000000000000004),[8]    "h  (0x8000000122688EE1)} at: COMPACT RECORD(info_bits=0, 4 fields): {[8]      $ (0x80000000000024F2),[8]        (0x8000000000000004),[8]     d0 (0x8000000000643016),[4]   &(0x00001B26)}
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 2024-01-21 15:40:22 0 [Note] Server socket created on IP: '127.0.0.1'.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: 240121 15:40:22 [ERROR] mysqld got signal 11 ;
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: Sorry, we probably made a mistake, and this is a bug.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: Your assistance in bug reporting will enable us to fix this for the next release.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: To report this bug, see https://mariadb.com/kb/en/reporting-bugs
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: We will try our best to scrape up some info that will hopefully help
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: diagnose the problem, but since we have already crashed,
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: something is definitely wrong and this may fail.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: Server version: 10.6.16-MariaDB-1:10.6.16+maria~deb11 source revision: b83c379420a8846ae4b28768d3c81fa354cca056
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: key_buffer_size=134217728
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: read_buffer_size=131072
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: max_used_connections=0
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: max_threads=153
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: thread_count=1
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: It is possible that mysqld could use up to
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 468013 K  bytes of memory
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: Hope that's ok; if not, decrease some variables in the equation.
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: Thread pointer: 0x0
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: Attempting backtrace. You can use the following information to find out
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: where mysqld died. If you see no messages after this, something went
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: terribly wrong...
Jan 21 15:40:22 nextcloudpi mariadbd[18090]: stack_bottom = 0x0 thread_stack 0x49000
Jan 21 15:40:22 nextcloudpi systemd[1]: mariadb.service: Main process exited, code=killed, status=11/SEGV
Jan 21 15:40:22 nextcloudpi systemd[1]: mariadb.service: Failed with result 'signal'.
Jan 21 15:40:22 nextcloudpi systemd[1]: Failed to start MariaDB 10.6.16 database server.

And this is repeatedly done over and over again. Right now its #91 running. Always the same loop.

Can you send here the output from:

sudo mysqld --verbose --user root

2024-01-22  7:29:16 0 [Note] Starting MariaDB 10.6.16-MariaDB-1:10.6.16+maria~deb11 source revision b83c379420a8846ae4b28768d3c81fa354cca056 as process 388705
2024-01-22  7:29:16 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-01-22  7:29:16 0 [Note] InnoDB: Number of pools: 1
2024-01-22  7:29:16 0 [Note] InnoDB: Using ARMv8 crc32 + pmull instructions
2024-01-22  7:29:16 0 [Note] InnoDB: Using liburing
2024-01-22  7:29:16 0 [Note] InnoDB: Initializing buffer pool, total size = 1073741824, chunk size = 134217728
2024-01-22  7:29:16 0 [Note] InnoDB: Completed initialization of buffer pool
2024-01-22  7:29:17 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=63209452151,63209452151
2024-01-22  7:29:17 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 2 row operations to undo
2024-01-22  7:29:17 0 [Note] InnoDB: Trx id counter is 63341608
2024-01-22  7:29:17 0 [Note] InnoDB: To recover: 376 pages
2024-01-22  7:29:17 0 [Note] InnoDB: 128 rollback segments are active.
2024-01-22  7:29:17 0 [Note] InnoDB: Starting in background the rollback of recovered transactions
2024-01-22  7:29:17 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2024-01-22  7:29:17 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-01-22  7:29:17 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2024-01-22  7:29:17 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2024-01-22  7:29:17 0 [Note] InnoDB: 10.6.16 started; log sequence number 63215740322; transaction id 63341609
2024-01-22  7:29:17 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-01-22  7:29:17 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2024-01-22  7:29:17 0 [Warning] 'innodb-large-prefix' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
2024-01-22  7:29:17 0 [Warning] 'innodb-file-format' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
2024-01-22  7:29:17 0 [Warning] 'innodb-buffer-pool-instances' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
2024-01-22  7:29:17 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2024-01-22  7:29:17 0 [Warning] InnoDB: Record in index `fs_id_storage_size` of table `nextcloud`.`oc_filecache` was not found on rollback, trying to insert: TUPLE (info_bits=0, 3 fields): {[8]      $ (0x80000000000024FA),[8]        (0x8000000000000004),[8]    "h  (0x8000000122688EE1)} at: COMPACT RECORD(info_bits=0, 4 fields): {[8]      $ (0x80000000000024F2),[8]        (0x8000000000000004),[8]     d0 (0x8000000000643016),[4]   &(0x00001B26)}
2024-01-22  7:29:17 0 [Note] Server socket created on IP: '127.0.0.1'.
2024-01-22  7:29:17 0 [ERROR] Incorrect definition of table mysql.event: expected column 'definer' at position 3 to have type varchar(, found type char(141).
2024-01-22  7:29:17 0 [ERROR] mysqld: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
240122  7:29:17 [ERROR] mysqld got signal 11 ;
Sorry, we probably made a mistake, and this is a bug.

Your assistance in bug reporting will enable us to fix this for the next release.
To report this bug, see https://mariadb.com/kb/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

Server version: 10.6.16-MariaDB-1:10.6.16+maria~deb11 source revision: b83c379420a8846ae4b28768d3c81fa354cca056
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=0
max_threads=153
thread_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 468013 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x0 thread_stack 0x49000
2024-01-22  7:29:17 0 [Note] mysqld: ready for connections.
Version: '10.6.16-MariaDB-1:10.6.16+maria~deb11'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
Speicherzugriffsfehler
Sie haben neue Post in /var/mail/root.

ok next step :slight_smile:

The line

Incorrect definition of table mysql.event: expected column ‘definer’ at position 3 to have type varchar(, found type char(141).

is documented here in the link above, and solved with the comment:

This occurs after mariadb has been upgraded between point versions and before mysql_upgrade has been run. with:

mysql_upgrade

I would suggest starting with

mysql_upgrade --check-if-upgrade-is-needed

Please backup all and read the fine manual first! Touching a database blind and remotly comes with risks and I havn’t tested this commands.

Let me know…

https://jira.mariadb.org/browse/MDEV-26342

Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (111)
FATAL ERROR: Upgrade failed

Did not yet run the mysql_upgrade.
First wanted to have your feedback.

edit after further digging into the error message:
According to this article, there needs to be a mysql-server package installed, up and running. I checked via apt list --installed | grep mysql-server. Result: It’s not. Totally unaware and inexperienced with db and socket stuff, I could imagine, this is a root cause. Just writing this proactively, cause you might be under the assumption, that this is already installed on my machine.