Nextcloudpi down suddenly after auto update

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

The issue you are facing:
Unable to access Nextcloudpi, either client or admin page. I think autoupdate feature of nextcloud has done something wrong with MariaDB service

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

Steps to replicate it:

The output of ncp-report:

NextCloudPi diagnostics

NextCloudPi version  v1.29.8
NextCloudPi image    NextCloudPi_docker_04-06-20
distribution         Debian GNU/Linux 10 \n \l
automount            no
USB devices          none
datadir              /data/nextcloud/data
data in SD           yes
data filesystem      ext2/ext3
data disk usage      11G/117G
rootfs usage         11G/117G
swapfile             /var/swap
dbdir                /data/database
Nextcloud check      error
HTTPD service        down
PHP service          up
MariaDB service      down
Redis service        up
Postfix service      up
internet check       ok
port check 80        closed
port check 443       closed
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               1:05

Nextcloud configuration

An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused in /data/nextcloud/lib/private/DB/Connection.php:67
Stack trace:
#0 /data/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(889): OC\DB\Connection->connect()
#1 /data/nextcloud/lib/private/DB/Connection.php(194): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#2 /data/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(200): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#3 /data/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(216): Doctrine\DBAL\Query\QueryBuilder->execute()
#4 /data/nextcloud/lib/private/AppConfig.php(331): OC\DB\QueryBuilder\QueryBuilder->execute()
#5 /data/nextcloud/lib/private/AppConfig.php(109): OC\AppConfig->loadConfigValues()
#6 /data/nextcloud/lib/private/AppConfig.php(287): OC\AppConfig->getApps()
#7 /data/nextcloud/lib/private/legacy/OC_App.php(883): OC\AppConfig->getValues(false, 'installed_versi...')
#8 /data/nextcloud/lib/private/Server.php(665): OC_App::getAppVersions()
#9 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#10 /data/nextcloud/lib/private/ServerContainer.php(124): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#11 /data/nextcloud/lib/private/Server.php(1704): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#12 /data/nextcloud/lib/private/Server.php(856): OC\Server->getMemCacheFactory()
#13 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#14 /data/nextcloud/lib/private/ServerContainer.php(124): Pimple\Container->offsetGet('OC\\App\\AppManag...')
#15 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(163): OC\ServerContainer->query('OC\\App\\AppManag...')
#16 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#17 /data/nextcloud/lib/private/ServerContainer.php(124): Pimple\Container->offsetGet('OCP\\App\\IAppMan...')
#18 /data/nextcloud/lib/private/Server.php(1894): OC\ServerContainer->query('OCP\\App\\IAppMan...')
#19 /data/nextcloud/lib/private/legacy/OC_App.php(347): OC\Server->getAppManager()
#20 /data/nextcloud/lib/private/legacy/OC_Util.php(1438): OC_App::getEnabledApps(false, true)
#21 /data/nextcloud/lib/public/Util.php(516): OC_Util::needUpgrade(Object(OC\SystemConfig))
#22 /data/nextcloud/lib/base.php(719): OCP\Util::needUpgrade()
#23 /data/nextcloud/lib/base.php(1095): OC::init()
#24 /data/nextcloud/console.php(49): require_once('/data/nextcloud...')
#25 /data/nextcloud/occ(11): require_once('/data/nextcloud...')
#26 {main}
HTTPd logs

[Mon Sep 14 15:48:34.359293 2020] [ssl:warn] [pid 94:tid 3070176688] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 14 15:48:34.390707 2020] [ssl:warn] [pid 95:tid 3070176688] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 14 15:48:34.395966 2020] [mpm_event:notice] [pid 95:tid 3070176688] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Mon Sep 14 15:48:34.396071 2020] [core:notice] [pid 95:tid 3070176688] AH00094: Command line: '/usr/sbin/apache2'
[Tue Sep 15 13:18:29.322276 2020] [authz_host:error] [pid 97:tid 2703221792] [client 83.143.86.62:47618] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Tue Sep 15 13:18:29.322481 2020] [authz_core:error] [pid 97:tid 2703221792] [client 83.143.86.62:47618] AH01630: client denied by server configuration: /var/www/ncp-web/
[Tue Sep 15 13:19:41.060384 2020] [mpm_event:notice] [pid 95:tid 3070176688] AH00492: caught SIGWINCH, shutting down gracefully
[Tue Sep 15 13:20:13.280940 2020] [ssl:warn] [pid 93:tid 3069377968] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Sep 15 13:20:13.320272 2020] [ssl:warn] [pid 94:tid 3069377968] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Sep 15 13:20:13.333372 2020] [mpm_event:notice] [pid 94:tid 3069377968] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Tue Sep 15 13:20:13.333538 2020] [core:notice] [pid 94:tid 3069377968] AH00094: Command line: '/usr/sbin/apache2'
[Tue Sep 15 15:20:28.940551 2020] [authz_core:error] [pid 96:tid 2638099488] [client 167.248.133.35:34620] AH01630: client denied by server configuration: /var/www/ncp-web/
[Tue Sep 15 15:20:29.911162 2020] [authz_core:error] [pid 97:tid 2722092064] [client 167.248.133.35:43708] AH01630: client denied by server configuration: /var/www/ncp-web/
[Wed Sep 16 01:13:02.575932 2020] [mpm_event:notice] [pid 94:tid 3069377968] AH00492: caught SIGWINCH, shutting down gracefully
[Wed Sep 16 01:13:33.256356 2020] [ssl:warn] [pid 93:tid 3070074288] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 16 01:13:33.288209 2020] [ssl:warn] [pid 94:tid 3070074288] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 16 01:13:33.299489 2020] [mpm_event:notice] [pid 94:tid 3070074288] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Wed Sep 16 01:13:33.299650 2020] [core:notice] [pid 94:tid 3070074288] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 16 01:36:45.243661 2020] [mpm_event:notice] [pid 94:tid 3070074288] AH00492: caught SIGWINCH, shutting down gracefully

Database logs

2020-09-16  1:13:34 0 [Note] InnoDB: 10.3.23 started; log sequence number 90854026; transaction id 278113
2020-09-16  1:13:34 0 [Note] InnoDB: Loading buffer pool(s) from /data/database/ib_buffer_pool
2020-09-16  1:13:34 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-09-16  1:13:34 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-09-16  1:13:34 0 [Note] Reading of all Master_info entries succeeded
2020-09-16  1:13:34 0 [Note] Added new Master_info '' to hash table
2020-09-16  1:13:34 0 [Note] mysqld: ready for connections.
Version: '10.3.23-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 10
2020-09-16  1:13:34 0 [Note] InnoDB: Buffer pool(s) load completed at 200916  1:13:34
2020-09-16  1:36:45 0 [Note] mysqld (initiated by: root[root] @ localhost []): Normal shutdown
2020-09-16  1:36:45 0 [Note] Event Scheduler: Purging the queue. 0 events
2020-09-16  1:36:45 0 [Note] InnoDB: FTS optimize thread exiting.
2020-09-16  1:36:45 0 [Note] InnoDB: Starting shutdown...
2020-09-16  1:36:45 0 [Note] InnoDB: Dumping buffer pool(s) to /data/database/ib_buffer_pool
2020-09-16  1:36:45 0 [Note] InnoDB: Buffer pool(s) dump completed at 200916  1:36:45
2020-09-16  1:36:47 0 [Note] InnoDB: Shutdown completed; log sequence number 90890670; transaction id 278404
2020-09-16  1:36:47 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-09-16  1:36:47 0 [Note] mysqld: Shutdown complete


The output of your Nextcloud log in Admin > Logging:

don't know how to do

The output of your Apache/nginx/system log in /var/log/____:

don't know how to do

I solved it by deleting /var/run/apache2 in order to run apache2 service, I rerun mariaDB and then I had accessed to admin page, but I still get Nextcloud check fail with internal error page:

Database logs

2020-09-16  1:13:34 0 [Note] InnoDB: 10.3.23 started; log sequence number 90854026; transaction id 278113
2020-09-16  1:13:34 0 [Note] InnoDB: Loading buffer pool(s) from /data/database/ib_buffer_pool
2020-09-16  1:13:34 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-09-16  1:13:34 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-09-16  1:13:34 0 [Note] Reading of all Master_info entries succeeded
2020-09-16  1:13:34 0 [Note] Added new Master_info '' to hash table
2020-09-16  1:13:34 0 [Note] mysqld: ready for connections.
Version: '10.3.23-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 10
2020-09-16  1:13:34 0 [Note] InnoDB: Buffer pool(s) load completed at 200916  1:13:34
2020-09-16  1:36:45 0 [Note] mysqld (initiated by: root[root] @ localhost []): Normal shutdown
2020-09-16  1:36:45 0 [Note] Event Scheduler: Purging the queue. 0 events
2020-09-16  1:36:45 0 [Note] InnoDB: FTS optimize thread exiting.
2020-09-16  1:36:45 0 [Note] InnoDB: Starting shutdown...
2020-09-16  1:36:45 0 [Note] InnoDB: Dumping buffer pool(s) to /data/database/ib_buffer_pool
2020-09-16  1:36:45 0 [Note] InnoDB: Buffer pool(s) dump completed at 200916  1:36:45
2020-09-16  1:36:47 0 [Note] InnoDB: Shutdown completed; log sequence number 90890670; transaction id 278404
2020-09-16  1:36:47 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-09-16  1:36:47 0 [Note] mysqld: Shutdown complete


I don’t know how to fix it, therefore I made a restore from admin page.