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

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.

As you are running Debian 11 have you checked this:
apt list --installed | grep maria

libmariadb3/unbekannt,now 1:10.6.16+maria~deb11 arm64  [Installiert,automatisch]
mariadb-client-10.6/unbekannt,now 1:10.6.16+maria~deb11 arm64  [Installiert,automatisch]
mariadb-client-core-10.6/unbekannt,now 1:10.6.16+maria~deb11 arm64  [Installiert,automatisch]
mariadb-common/unbekannt,now 1:10.6.16+maria~deb11 all  [Installiert,automatisch]
mariadb-server-10.6/unbekannt,now 1:10.6.16+maria~deb11 arm64  [Installiert,automatisch]
mariadb-server-core-10.6/unbekannt,now 1:10.6.16+maria~deb11 arm64  [Installiert,automatisch]
mariadb-server/unbekannt,now 1:10.6.16+maria~deb11 all  [installiert]
mysql-common/unbekannt,now 1:10.6.16+maria~deb11 all  [Installiert,automatisch]

ok :sweat_smile:

is installed

mariadb-server-core-10.6/unbekannt,now 1:10.6.16+maria~deb11 arm64 [Installiert,automatisch]

Now make a basic backup please:

cp -r /datadir/ /backup_path/

datadir is where you mysql-data is located and /backup_path/ is your backup_path

Next step should be:
sudo mariadb-upgrade -u root -p

and after entering the password. We will see.

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

As password my root pwd has been used.

Ok, I thought so, a little bit, it is only the database.
Now as you have a backup please try to follow the instruction in one of the links, and please let me know.

@sambilanet
Both of the links contain various solution approaches. So I am not sure, what you are referring to.

What I did:

  • sudo find / -type s to find the socket file β†’ /run/mysqld/mysqld.sock
  • added socket=/run/mysqld/mysql.sock to /etc/mysql/my.cnf
  • service mysqld stop
  • /etc/init.d/mysqld stop that delivered: bash: /etc/init.d/mysqld: Datei oder Verzeichnis nicht gefunden
  • mysqladmin -u root -p shutdown that delivered mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local server through socket '/run/mysqld/mysqld.sock' (111)' Check that mariadbd is running and that the socket: '/run/mysqld/mysqld.sock' exists!
  • deleted .pid file under /var/run/mysqld/
  • checked permissions of socket file
  • service mysqld start delivered: Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

So that did not work.

The other link suggested to install mysql-server package. I already found that solution, that is why I posted earlier, that the package is not installed. Shall I also try this approach?

Please note that both of the links to stackoverflow tackle the error with the (2), but mine has the (111) β†’ ```
ERROR 2002 (HY000): Can’t connect to local server through socket β€˜/run/mysqld/mysqld.sock’ (111)

I am lost, what to do.

ok,

Please show the log after executing:

systemctl status mariadb.service
journalctl -xe

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 Wed 2024-01-24 20:15:41 CET; 3s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 1709148 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 1709149 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 1709151 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set>
Cntrl PID: 1709231 (sleep)
      Tasks: 1 (limit: 4206)
     Memory: 180.0K
        CPU: 230ms
     CGroup: /system.slice/mariadb.service
             └─1709231 /bin/sleep 20

Jan 24 20:15:41 nextcloudpi systemd[1]: Starting MariaDB 10.6.16 database server...
lines 1-18/18 (END)
 journalctl -xe
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: Completed initialization of buffer pool
Jan 24 20:16:28 nextcloudpi sudo[1709405]: pam_unix(sudo:session): session closed for user www-data
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=63209452151,63209452151
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 2 row operations to u>
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: Trx id counter is 63341608
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: To recover: 376 pages
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: 128 rollback segments are active.
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: Starting in background the rollback of recovered transactions
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: Creating shared tablespace for temporary tables
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: 10.6.16 started; log sequence number 63223002448; transaction id 63341609
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] Plugin 'FEEDBACK' is disabled.
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Warning] 'innodb-large-prefix' was removed. It does nothing now and exists only for compatibility wit>
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Warning] 'innodb-file-format' was removed. It does nothing now and exists only for compatibility with>
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Warning] 'innodb-buffer-pool-instances' was removed. It does nothing now and exists only for compatib>
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Warning] InnoDB: Record in index `fs_id_storage_size` of table `nextcloud`.`oc_filecache` was not fou>
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 2024-01-24 20:16:28 0 [Note] Server socket created on IP: '127.0.0.1'.
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: 240124 20:16:28 [ERROR] mysqld got signal 11 ;
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: Sorry, we probably made a mistake, and this is a bug.
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: Your assistance in bug reporting will enable us to fix this for the next release.
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: To report this bug, see https://mariadb.com/kb/en/reporting-bugs
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: We will try our best to scrape up some info that will hopefully help
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: diagnose the problem, but since we have already crashed,
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: something is definitely wrong and this may fail.
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: Server version: 10.6.16-MariaDB-1:10.6.16+maria~deb11 source revision: b83c379420a8846ae4b28768d3c81fa354cca056
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: key_buffer_size=134217728
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: read_buffer_size=131072
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: max_used_connections=0
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: max_threads=153
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: thread_count=1
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: It is possible that mysqld could use up to
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 468013 K  bytes of memory
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: Hope that's ok; if not, decrease some variables in the equation.
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: Thread pointer: 0x0
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: Attempting backtrace. You can use the following information to find out
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: where mysqld died. If you see no messages after this, something went
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: terribly wrong...
Jan 24 20:16:28 nextcloudpi mariadbd[1709407]: stack_bottom = 0x0 thread_stack 0x49000
Jan 24 20:16:28 nextcloudpi systemd[1]: mariadb.service: Main process exited, code=killed, status=11/SEGV
β–‘β–‘ Subject: Unit process exited
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘
β–‘β–‘ An ExecStart= process belonging to unit mariadb.service has exited.
β–‘β–‘
β–‘β–‘ The process' exit code is 'killed' and its exit status is 11.
Jan 24 20:16:28 nextcloudpi systemd[1]: mariadb.service: Failed with result 'signal'.
β–‘β–‘ Subject: Unit failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘
β–‘β–‘ The unit mariadb.service has entered the 'failed' state with result 'signal'.
Jan 24 20:16:28 nextcloudpi systemd[1]: Failed to start MariaDB 10.6.16 database server.
β–‘β–‘ Subject: A start job for unit mariadb.service has failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘
β–‘β–‘ A start job for unit mariadb.service has finished with a failure.
β–‘β–‘
β–‘β–‘ The job identifier is 1302505 and the job result is failed.
Jan 24 20:16:31 nextcloudpi sudo[1709428]:     root : PWD=/ ; USER=www-data ; COMMAND=/usr/bin/php /var/www/nextcloud/occ config:system:get overwrite.cli.url
Jan 24 20:16:31 nextcloudpi sudo[1709428]: pam_unix(sudo:session): session opened for user www-data(uid=33) by (uid=0)
Jan 24 20:16:31 nextcloudpi sudo[1709428]: pam_unix(sudo:session): session closed for user www-data
Jan 24 20:16:32 nextcloudpi notify_push[1709279]: Error:
Jan 24 20:16:32 nextcloudpi notify_push[1709279]:   Γ— Failed to connect to database
Jan 24 20:16:32 nextcloudpi notify_push[1709279]:   ╰─▢ pool timed out while waiting for an open connection
Jan 24 20:16:32 nextcloudpi systemd[1]: notify_push.service: Main process exited, code=exited, status=1/FAILURE
β–‘β–‘ Subject: Unit process exited
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘
β–‘β–‘ An ExecStart= process belonging to unit notify_push.service has exited.
β–‘β–‘
β–‘β–‘ The process' exit code is 'exited' and its exit status is 1.
Jan 24 20:16:32 nextcloudpi systemd[1]: notify_push.service: Failed with result 'exit-code'.
β–‘β–‘ Subject: Unit failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘
β–‘β–‘ The unit notify_push.service has entered the 'failed' state with result 'exit-code'.
lines 1581-1664/1664 (END)