Nextcloud check error MariaDB service down

Hello,

I had Nextcloupi running on a RasperryPi 4 but today both access to Nextcloud and Nexcloupi were loading forever.
I turned off the power an then back on.
Since then, I have access to Nextcloudpi with two red flags in the system info:

  • Nextcloud check error
  • MariaDB service down

How can I solve this please?

Here is the ncp-report:

NextCloudPi diagnostics

Cannot load Zend OPcache - it was already loaded
NextCloudPi version  v1.35.0
NextCloudPi image    NextCloudPi_03-28-20
distribution         Raspbian GNU/Linux 10 \n \l
automount            yes
USB devices          sda
datadir              /media/Données/ncdata
data in SD           no
data filesystem      btrfs
data disk usage      75G/7.3T
rootfs usage         4.8G/29G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      error
HTTPD service        up
PHP service          up
MariaDB service      down
Redis service        up
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         yes
uptime               1:22

Nextcloud configuration

Cannot load Zend OPcache - it was already loaded
An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:72
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1449): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(892): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(202): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(217): 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(949): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /var/www/nextcloud/lib/private/Server.php(668): 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(156): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', true)
#14 /var/www/nextcloud/lib/private/Server.php(1677): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#15 /var/www/nextcloud/lib/private/Server.php(1017): OC\Server->getMemCacheFactory()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): 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\\Lock\\ILocki...')
#19 /var/www/nextcloud/lib/private/ServerContainer.php(156): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', true)
#20 /var/www/nextcloud/lib/private/Server.php(1977): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#21 /var/www/nextcloud/lib/private/Files/View.php(118): OC\Server->getLockingProvider()
#22 /var/www/nextcloud/lib/private/Server.php(395): OC\Files\View->__construct()
#23 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#24 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#25 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#26 /var/www/nextcloud/lib/private/ServerContainer.php(156): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', true)
#27 /var/www/nextcloud/lib/private/Server.php(1324): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#28 /var/www/nextcloud/lib/base.php(595): OC\Server->boot()
#29 /var/www/nextcloud/lib/base.php(1091): OC::init()
#30 /var/www/nextcloud/console.php(49): require_once('/var/www/nextcl...')
#31 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#32 {main}
HTTPd logs

[Sat Mar 27 18:53:04.165695 2021] [authz_host:error] [pid 782:tid 2806215712] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /img/toggle.svg failed, reason: unable to get the remote host name
[Sat Mar 27 18:53:04.165900 2021] [authz_host:error] [pid 782:tid 2806215712] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /img/defaults.svg failed, reason: unable to get the remote host name
[Sat Mar 27 18:53:04.166824 2021] [authz_host:error] [pid 782:tid 2764211232] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /js/minified.js failed, reason: unable to get the remote host name
[Sat Mar 27 18:53:04.166824 2021] [authz_host:error] [pid 782:tid 2772612128] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /js/ncp.js failed, reason: unable to get the remote host name
[Sat Mar 27 18:53:04.168982 2021] [authz_host:error] [pid 782:tid 2772612128] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /img/poweroff.svg failed, reason: unable to get the remote host name
[Sat Mar 27 18:53:04.169217 2021] [authz_host:error] [pid 782:tid 2772612128] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /img/reboot.svg failed, reason: unable to get the remote host name
[Sat Mar 27 18:53:04.169368 2021] [authz_host:error] [pid 782:tid 2755810336] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /js/minified.js failed, reason: unable to get the remote host name, referer: https://192.168.1.5:4443/?app=dashboard
[Sat Mar 27 18:53:04.204408 2021] [authz_host:error] [pid 782:tid 2755810336] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /img/favicon.png failed, reason: unable to get the remote host name
[Sat Mar 27 18:53:04.221231 2021] [authz_host:error] [pid 782:tid 2755810336] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /ncp-output.php failed, reason: unable to get the remote host name
[Sat Mar 27 18:53:04.243077 2021] [authz_host:error] [pid 782:tid 2806215712] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Sat Mar 27 18:53:04.410958 2021] [authz_host:error] [pid 782:tid 2806215712] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Sat Mar 27 18:55:05.589067 2021] [authz_host:error] [pid 782:tid 2806215712] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Sat Mar 27 18:55:05.729502 2021] [authz_host:error] [pid 782:tid 2806215712] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Sat Mar 27 18:55:05.729818 2021] [authz_host:error] [pid 782:tid 2806215712] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Sat Mar 27 18:55:05.810776 2021] [authz_host:error] [pid 782:tid 2806215712] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Sat Mar 27 18:55:06.139698 2021] [authz_host:error] [pid 782:tid 2806215712] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /img/favicon.png failed, reason: unable to get the remote host name
[Sat Mar 27 18:55:06.169239 2021] [authz_host:error] [pid 782:tid 2806215712] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /ncp-output.php failed, reason: unable to get the remote host name
[Sat Mar 27 18:55:06.191077 2021] [authz_host:error] [pid 782:tid 2755810336] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Sat Mar 27 18:55:11.689175 2021] [authz_host:error] [pid 782:tid 2755810336] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Sat Mar 27 18:55:14.532003 2021] [authz_host:error] [pid 782:tid 2755810336] [client 192.168.1.6:50480] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name

Database logs

2021-03-27 18:50:38 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-03-27 18:50:38 0 [Note] InnoDB: Number of pools: 1
2021-03-27 18:50:38 0 [Note] InnoDB: Using generic crc32 instructions
2021-03-27 18:50:38 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 1, chunk size = 128M
2021-03-27 18:50:38 0 [Note] InnoDB: Completed initialization of buffer pool
2021-03-27 18:50:38 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-03-27 18:50:38 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-03-27 18:50:38 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-03-27 18:50:38 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-03-27 18:50:38 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-03-27 18:50:38 0 [Note] InnoDB: 10.3.27 started; log sequence number 1086400384; transaction id 4010808
2021-03-27 18:50:38 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-03-27 18:50:38 0 [Note] InnoDB: Buffer pool(s) load completed at 210327 18:50:38
2021-03-27 18:50:38 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-03-27 18:50:38 0 [Note] Recovering after a crash using tc.log
2021-03-27 18:50:38 0 [ERROR] Bad magic header in tc log
2021-03-27 18:50:38 0 [ERROR] Crash recovery failed. Either correct the problem (if it's, for example, out of memory error) and restart, or delete tc log and start mysqld with --tc-heuristic-recover={commit|rollback}
2021-03-27 18:50:38 0 [ERROR] Can't init tc log
2021-03-27 18:50:38 0 [ERROR] Aborting


I usually start with a search on my favorite search engine with the main error message from the log.

Have you tried starting mariadb manually? Or follow instruction from error log?

1 Like

Hello,

I deleted the tc log following those instructions: Failed to connect to the database, MiraDB problem - #4 by MichaIng and now it works!

I was not able to identify the main error message, thanks a lot for pointing this out to me @OliverV , your help is much appreciated!

Have a nice day,

2 Likes