Maria DB not starting after NCP Update 1.41.10

This morning i couldnt connect to Nextcloud “Internal Server Error”

Reboot did not help.

ncp-update

pi@nextcloudpi:~ $ sudo ncp-update
Downloading updates
Performing updates
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:85
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(965): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /var/www/nextcloud/lib/private/Server.php(682): OC_App::getAppVersions()

MariaDB Status

pi@nextcloudpi:~ $ systemctl status mariadb
● mariadb.service - MariaDB 10.3.31 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2021-10-22 09:26:28 CEST; 2min 11s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 3533 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
  Process: 3534 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS
  Process: 3536 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/gal
  Process: 3632 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=
 Main PID: 3632 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Oct 22 09:26:21 nextcloudpi systemd[1]: Starting MariaDB 10.3.31 database server...
Oct 22 09:26:22 nextcloudpi mysqld[3632]: 2021-10-22  9:26:22 0 [Note] /usr/sbin/mysqld (mysqld 10.3.31-MariaDB-0+deb10u
Oct 22 09:26:28 nextcloudpi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Oct 22 09:26:28 nextcloudpi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Oct 22 09:26:28 nextcloudpi systemd[1]: Failed to start MariaDB 10.3.31 database server.

df

Filesystem      1K-blocks       Used Available Use% Mounted on
/dev/root        30400236   30227092         0 100% /
devtmpfs          1800564          0   1800564   0% /dev
tmpfs             1965428          0   1965428   0% /dev/shm
tmpfs             1965428       8724   1956704   1% /run
tmpfs                5120          4      5116   1% /run/lock
tmpfs             1965428          0   1965428   0% /sys/fs/cgroup
/dev/mmcblk0p1     258096      49242    208854  20% /boot
/dev/sdb       1953481728 1136128088 814110568  59% /mnt/hd2
/dev/sda       1953481728 1136928220 815446980  59% /mnt/hd1
tmpfs              393084          0    393084   0% /run/user/1000

ncp-report

<--! Paste this in GitHub report -->

<details>
<summary>NextCloudPi diagnostics</summary>

NextCloudPi version v1.41.10
NextCloudPi image NextCloudPi_07-21-19
OS Raspbian GNU/Linux 10. 5.10.63-v7l+ (armv7l)
automount no
USB devices sda sdb
datadir /mnt/hd1/nextcloud/data
data in SD no
data filesystem btrfs
data disk usage 1.1T/1.9T
rootfs usage 29G/29G
swapfile /var/swap
dbdir /var/lib/mysql
Nextcloud check error
HTTPD service up
PHP service up
MariaDB service down
Redis service up
HPB service down
Postfix service up
internet check ok
port check 80 open
port check 443 open
IP REMOVED SENSITIVE VALUE
gateway REMOVED SENSITIVE VALUE
interface eth0
certificates REMOVED SENSITIVE VALUE
NAT loopback no
uptime 29min

</details>


<details>
<summary>Nextcloud configuration</summary>

An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:85
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery(‘SELECT * FROM ...', Array, Array, NULL) #3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery('SELECT * FROM …’, Array, Array)
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(965): OC\AppConfig->getValues(false, ‘installed_versi…’)
#9 /var/www/nextcloud/lib/private/Server.php(682): OC_App::getAppVersions()
#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC{closure}(Object(OC\Server))
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(Pimple\Container))
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet(‘OC\Memcache\Fac…’)
#13 /var/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query(‘OC\Memcache\Fac…’, false)
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query(‘OC\Memcache\Fac…’)
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(177): OC\AppFramework\Utility\SimpleContainer->get(‘OC\Memcache\Fac…’)
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(OC\Server))
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(Pimple\Container))
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet(‘OCP\ICacheFacto…’)
#19 /var/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query(‘OCP\ICacheFacto…’, false)
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query(‘OCP\ICacheFacto…’)
#21 /var/www/nextcloud/lib/private/Server.php(1031): OC\AppFramework\Utility\SimpleContainer->get(‘OCP\ICacheFacto…’)
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC{closure}(Object(OC\Server))
#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(Pimple\Container))
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet(‘OCP\Lock\ILocki…’)
#25 /var/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query(‘OCP\Lock\ILocki…’, false)
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query(‘OCP\Lock\ILocki…’)
#27 /var/www/nextcloud/lib/private/Server.php(1990): OC\AppFramework\Utility\SimpleContainer->get(‘OCP\Lock\ILocki…’)
#28 /var/www/nextcloud/lib/private/Files/View.php(119): OC\Server->getLockingProvider()
#29 /var/www/nextcloud/lib/private/Server.php(430): OC\Files\View->__construct()
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC{closure}(Object(OC\Server))
#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(Pimple\Container))
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet(‘OC\Files\Node\H…’)
#33 /var/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query(‘OC\Files\Node\H…’, false)
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query(‘OC\Files\Node\H…’)
#35 /var/www/nextcloud/lib/private/Server.php(1353): OC\AppFramework\Utility\SimpleContainer->get(‘OC\Files\Node\H…’)
#36 /var/www/nextcloud/lib/base.php(588): OC\Server->boot()
#37 /var/www/nextcloud/lib/base.php(1076): OC::init()
#38 /var/www/nextcloud/console.php(49): require_once(’/var/www/nextcl…’)
#39 /var/www/nextcloud/occ(11): require_once(’/var/www/nextcl…’)
#40 {main}

</details>


<details>
<summary>HTTPd logs</summary>

[Fri Oct 22 00:00:05.347527 2021] [mpm_event:notice] [pid 1390:tid 3069702720] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1d configured – resuming normal operations
[Fri Oct 22 00:00:05.347562 2021] [core:notice] [pid 1390:tid 3069702720] AH00094: Command line: ‘/usr/sbin/apache2’
[Fri Oct 22 09:04:17.197041 2021] [mpm_event:notice] [pid 1390:tid 3069702720] AH00491: caught SIGTERM, shutting down
[Fri Oct 22 09:05:00.234313 2021] [ssl:warn] [pid 1214:tid 3069719104] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 22 09:05:00.281590 2021] [ssl:warn] [pid 1406:tid 3069719104] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 22 09:05:00.289516 2021] [mpm_event:notice] [pid 1406:tid 3069719104] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1d configured – resuming normal operations
[Fri Oct 22 09:05:00.289624 2021] [core:notice] [pid 1406:tid 3069719104] AH00094: Command line: ‘/usr/sbin/apache2’
[Fri Oct 22 09:22:04.377406 2021] [log_config:warn] [pid 1412:tid 2675958784] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:08.679801 2021] [proxy_fcgi:error] [pid 1412:tid 2755412992] [client 192.168.178.32:56036] AH01071: Got error ‘PHP message: PHP Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0PHP message: PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/sessions) in Unknown on line 0’
[Fri Oct 22 09:22:08.685747 2021] [log_config:warn] [pid 1412:tid 2667566080] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:08.693196 2021] [log_config:warn] [pid 1412:tid 2667566080] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:08.760810 2021] [log_config:warn] [pid 1412:tid 2667566080] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:08.761126 2021] [log_config:warn] [pid 1412:tid 2667566080] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:08.764305 2021] [log_config:warn] [pid 1412:tid 2667566080] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:08.764907 2021] [log_config:warn] [pid 1412:tid 2667566080] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:09.088430 2021] [log_config:warn] [pid 1412:tid 2659173376] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:09.101033 2021] [log_config:warn] [pid 1412:tid 2650780672] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:09.102849 2021] [log_config:warn] [pid 1412:tid 2650780672] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:09.141665 2021] [log_config:warn] [pid 1412:tid 2642387968] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Fri Oct 22 09:22:09.322052 2021] [log_config:warn] [pid 1412:tid 2633995264] (28)No space left on device: [client 192.168.178.32:56036] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log, referer: https://192.168.178.24

</details>

I have the same error, but it was after a power outage and hardware crashed. I still haven’t found a fix for it yet… Looks like corrupt database config tables/files

Partition is full. You first should free disk space.