Nextcloud unaccessible with a HTTP 500 error

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:

Nextcloud version (eg, 12.0.2): 15.0.5.3
Operating system and version (eg, Ubuntu 17.04): Raspbian 9 (strech)
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.25
PHP version (eg, 7.1): PHP 7.2.22

The issue you are facing:
I am unable to start or update my Nextcloud instance (I use NextcloudPi). The Database Connection crashes with a “No such File or Directory” error and when starting mariadb/mysql manually, it crashes.
Moreover, when opening nextcloud using the Web Browser, it shows a blank page and DAVx⁾ returns a HTTP 500 Error.

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

Steps to replicate it:
Unsure

The output of your Nextcloud log in Admin > Logging:
Since I am unable to access this, here is the output of nc-error.log:

[Tue Oct 01 14:27:04.397324 2019] [ssl:warn] [pid 499:tid 1995464944] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Oct 01 14:27:04.409783 2019] [ssl:error] [pid 499:tid 1995464944] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: FBCE4F86FB5AAA58 / notbefore: Mar  9 16:17:33 2019 GMT / notafter: Mar  6 16:17:33 2029 GMT]
[Tue Oct 01 14:27:04.410004 2019] [ssl:error] [pid 499:tid 1995464944] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Tue Oct 01 14:27:05.133713 2019] [ssl:warn] [pid 707:tid 1995464944] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Oct 01 14:27:05.134994 2019] [ssl:error] [pid 707:tid 1995464944] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: FBCE4F86FB5AAA58 / notbefore: Mar  9 16:17:33 2019 GMT / notafter: Mar  6 16:17:33 2029 GMT]
[Tue Oct 01 14:27:05.135311 2019] [ssl:error] [pid 707:tid 1995464944] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Tue Oct 01 14:27:06.146723 2019] [proxy:error] [pid 741:tid 1690543152] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.sock (*) failed
[Tue Oct 01 14:27:06.146968 2019] [proxy_fcgi:error] [pid 741:tid 1690543152] [client 192.168.3.100:49254] AH01079: failed to make connection to backend: httpd-UDS
[Tue Oct 01 14:33:41.710777 2019] [proxy_fcgi:error] [pid 741:tid 1690543152] [client 192.168.3.100:49270] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrin...\nPHP message: PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctrin...\n'

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

<?php
$CONFIG = array (
  'passwordsalt' => '*<removed>*',
  'secret' => '*<removed>*',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    5 => 'nextcloudpi.local',
    7 => 'nextcloudpi',
    8 => 'nextcloudpi.lan',
    1 => '192.168.3.7',
    11 => '94.134.92.100',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '15.0.5.3',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => '*<removed>*',
  'installed' => true,
  'instanceid' => 'ocmkxn4qrngc',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '*<removed>*',
  ),
  'tempdirectory' => '/var/www/nextcloud/data/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'overwriteprotocol' => 'https',
  'jpeg_quality' => '60',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
);

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

(/var/log/apache2/nc-access.log)

192.168.3.100 - - [01/Oct/2019:14:29:57 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:30:29 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:31:01 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:31:33 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:27:06 +0100] "GET /status.php HTTP/2.0" 503 299 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:33:41 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:34:13 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:34:39 +0100] "GET / HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.3.100 - - [01/Oct/2019:14:34:45 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:35:17 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:35:49 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:36:21 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:36:53 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:37:25 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:37:57 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:38:29 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:39:01 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:39:33 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:40:05 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:40:37 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:41:09 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:41:41 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:42:13 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:42:45 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:43:17 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:43:49 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:44:21 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:44:53 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:45:25 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:45:57 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:46:29 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:47:01 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:47:33 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:48:05 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:48:37 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:49:09 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:49:41 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:50:13 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:50:45 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:51:17 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:51:49 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"
192.168.3.100 - - [01/Oct/2019:14:52:21 +0100] "GET /status.php HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"


(/var/log/apache2/error.log)

[Tue Oct 01 06:25:02.964544 2019] [ssl:warn] [pid 669:tid 1996009712] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Oct 01 06:25:02.966203 2019] [ssl:error] [pid 669:tid 1996009712] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: FBCE4F86FB5AAA58 / notbefore: Mar  9 16:17:33 2019 GMT / notafter: Mar  6 16:17:33 2029 GMT]
[Tue Oct 01 06:25:02.966383 2019] [ssl:error] [pid 669:tid 1996009712] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Tue Oct 01 06:25:03.000546 2019] [mpm_event:notice] [pid 669:tid 1996009712] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2l configured -- resuming normal operations
[Tue Oct 01 06:25:03.002075 2019] [core:notice] [pid 669:tid 1996009712] AH00094: Command line: '/usr/sbin/apache2'
[Tue Oct 01 14:24:39.414281 2019] [log_config:warn] [pid 7673:tid 1571767344] (28)No space left on device: [client 192.168.3.100:39136] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Tue Oct 01 14:27:04.412619 2019] [ssl:warn] [pid 499:tid 1995464944] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Oct 01 14:27:04.422635 2019] [ssl:error] [pid 499:tid 1995464944] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: FBCE4F86FB5AAA58 / notbefore: Mar  9 16:17:33 2019 GMT / notafter: Mar  6 16:17:33 2029 GMT]
[Tue Oct 01 14:27:04.422791 2019] [ssl:error] [pid 499:tid 1995464944] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Tue Oct 01 14:27:05.137882 2019] [ssl:warn] [pid 707:tid 1995464944] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Oct 01 14:27:05.139404 2019] [ssl:error] [pid 707:tid 1995464944] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: FBCE4F86FB5AAA58 / notbefore: Mar  9 16:17:33 2019 GMT / notafter: Mar  6 16:17:33 2029 GMT]
[Tue Oct 01 14:27:05.139564 2019] [ssl:error] [pid 707:tid 1995464944] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Tue Oct 01 14:27:06.006645 2019] [mpm_event:notice] [pid 707:tid 1995464944] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2l configured -- resuming normal operations
[Tue Oct 01 14:27:06.007211 2019] [core:notice] [pid 707:tid 1995464944] AH00094: Command line: '/usr/sbin/apache2'

Furthermore, her are some command outputs:

systemctl start maradb

Warning: mariadb.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

systemctl status mariadb.service

 ● mariadb.service - MariaDB 10.1.37 database server
       Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
      Drop-In: /etc/systemd/system/mariadb.service.d
               └─ncp-delay-automount.conf
       Active: activating (start-pre) since Wed 2019-10-02 19:27:56 BST; 6s ago
         Docs: man:mysqld(8)
               https://mariadb.com/kb/en/library/systemd/
      Process: 27623 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
      Process: 27692 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
      Process: 27688 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
      Process: 27685 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
     Main PID: 27623 (code=exited, status=1/FAILURE); Control PID: 27817 (sleep)
        Tasks: 1 (limit: 4915)
       CGroup: /system.slice/mariadb.service
               └─control
                 └─27817 /bin/sleep 20

    Oct 02 19:27:56 nextcloudpi systemd[1]: Starting MariaDB 10.1.37 database server...

journalctl -xe

Oct 01 15:02:33 nextcloudpi bash[13332]: #25 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(98): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
Oct 01 15:02:33 nextcloudpi bash[13332]: #26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(119): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\Authenticati...')
Oct 01 15:02:34 nextcloudpi bash[13332]: #27 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...')
Oct 01 15:02:34 nextcloudpi bash[13332]: #28 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(165): OC\ServerContainer->query('OC\\Authenticati...')
Oct 01 15:02:34 nextcloudpi bash[13332]: #29 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
Oct 01 15:02:34 nextcloudpi bash[13332]: #30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('OC\\Authenticati...')
Oct 01 15:02:34 nextcloudpi bash[13332]: #31 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...')
Oct 01 15:02:34 nextcloudpi bash[13332]: #32 /var/www/nextcloud/lib/private/Server.php(372): OC\ServerContainer->query('OC\\Authenticati...')
Oct 01 15:02:34 nextcloudpi bash[13332]: #33 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
Oct 01 15:02:34 nextcloudpi bash[13332]: #34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('OC\\User\\Session')
Oct 01 15:02:34 nextcloudpi bash[13332]: #35 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OC\\User\\Session')
Oct 01 15:02:34 nextcloudpi bash[13332]: #36 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(165): OC\ServerContainer->query('OC\\User\\Session')
Oct 01 15:02:34 nextcloudpi bash[13332]: #37 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
Oct 01 15:02:34 nextcloudpi bash[13332]: #38 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('UserSession')
Oct 01 15:02:34 nextcloudpi bash[13332]: #39 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('UserSession')
Oct 01 15:02:34 nextcloudpi bash[13332]: #40 /var/www/nextcloud/lib/private/Server.php(1428): OC\ServerContainer->query('UserSession')
Oct 01 15:02:34 nextcloudpi bash[13332]: #41 /var/www/nextcloud/lib/private/Server.php(694): OC\Server->getUserSession()
Oct 01 15:02:34 nextcloudpi bash[13332]: #42 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
Oct 01 15:02:34 nextcloudpi bash[13332]: #43 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('OC\\App\\AppManag...')
Oct 01 15:02:34 nextcloudpi bash[13332]: #44 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OC\\App\\AppManag...')
Oct 01 15:02:34 nextcloudpi bash[13332]: #45 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(165): OC\ServerContainer->query('OC\\App\\AppManag...')
Oct 01 15:02:34 nextcloudpi bash[13332]: #46 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
Oct 01 15:02:34 nextcloudpi bash[13332]: #47 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('AppManager')
Oct 01 15:02:34 nextcloudpi bash[13332]: #48 /var/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
Oct 01 15:02:34 nextcloudpi bash[13332]: #49 /var/www/nextcloud/lib/private/Server.php(1723): OC\ServerContainer->query('AppManager')
Oct 01 15:02:34 nextcloudpi bash[13332]: #50 /var/www/nextcloud/lib/private/legacy/app.php(342): OC\Server->getAppManager()
Oct 01 15:02:34 nextcloudpi bash[13332]: #51 /var/www/nextcloud/lib/private/legacy/app.php(113): OC_App::getEnabledApps()
Oct 01 15:02:34 nextcloudpi bash[13332]: #52 /var/www/nextcloud/lib/base.php(654): OC_App::loadApps(Array)
Oct 01 15:02:34 nextcloudpi bash[13332]: #53 /var/www/nextcloud/lib/base.php(1068): OC::init()
Oct 01 15:02:34 nextcloudpi bash[13332]: #54 /var/www/nextcloud/console.php(46): require_once('/var/www/nextcl...')
Oct 01 15:02:34 nextcloudpi bash[13332]: #55 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
Oct 01 15:02:34 nextcloudpi systemd[1]: nextcloud-domain.service: Main process exited, code=exited, status=1/FAILURE
Oct 01 15:02:34 nextcloudpi sudo[13356]: pam_unix(sudo:session): session closed for user www-data
Oct 01 15:02:34 nextcloudpi bash[13332]: #56 {main}
Oct 01 15:02:34 nextcloudpi systemd[1]: nextcloud-domain.service: Unit entered failed state.
Oct 01 15:02:34 nextcloudpi systemd[1]: nextcloud-domain.service: Failed with result 'exit-code'.
Oct 01 15:02:37 nextcloudpi systemd[1]: mariadb.service: Service hold-off time over, scheduling restart.
Oct 01 15:02:37 nextcloudpi systemd[1]: Stopped MariaDB 10.1.37 database server.
-- Subject: Unit mariadb.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit mariadb.service has finished shutting down.
Oct 01 15:02:37 nextcloudpi systemd[1]: Starting MariaDB 10.1.37 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit mariadb.service has begun starting up.
Oct 01 15:02:39 nextcloudpi systemd[1]: nextcloud-domain.service: Service hold-off time over, scheduling restart.
Oct 01 15:02:39 nextcloudpi systemd[1]: Stopped Register Current IP as Nextcloud trusted domain.
-- Subject: Unit nextcloud-domain.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit nextcloud-domain.service has finished shutting down.

Thank you for help in advance!

Hi,

So you definitely have to fix the DB not starting up. That should be the root cause of all your issues.

Have you tried running that command mentioned here?
systemctl daemon-reload

If that doesn’t help, I’d run:
systemctl disable mariadb
systemctl enable mariadb

and afterwards try again:
systemctl start mariadb

Hi Schmu,
Thanks for the proposed solution. However, it still crashes, but hey, this time it seems to be a different error, which is at least something.

● mariadb.service - MariaDB 10.1.37 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─ncp-delay-automount.conf
   Active: activating (start-pre) since Wed 2019-10-02 19:27:56 BST; 6s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 27623 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 27692 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 27688 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 27685 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 27623 (code=exited, status=1/FAILURE); Control PID: 27817 (sleep)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/mariadb.service
           └─control
             └─27817 /bin/sleep 20

Oct 02 19:27:56 nextcloudpi systemd[1]: Starting MariaDB 10.1.37 database server...

Do you have any other ideas on how to fix this?
Do you need the output of other commands of logs?

looks like the output is cropped. Could you try to post the complete output of the start attempt?

Furthermore, please run the following command and provide the output:
journalctl -u mariadb -xe

You are using the Nextcloud-Pi image NCP?

-- Subject: Unit mariadb.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit mariadb.service has finished shutting down.
Oct 02 19:25:52 nextcloudpi systemd[1]: Starting MariaDB 10.1.37 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit mariadb.service has begun starting up.
Oct 02 19:26:14 nextcloudpi mysqld[27036]: 2019-10-02 19:26:14 1996300080 [Note] /usr/sbin/mysqld (mysqld 10.1.37-MariaDB-0+deb9u1) starting as process 27036 ...
Oct 02 19:26:18 nextcloudpi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Oct 02 19:26:18 nextcloudpi systemd[1]: Failed to start MariaDB 10.1.37 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit mariadb.service has failed.
-- 
-- The result is failed.
Oct 02 19:26:18 nextcloudpi systemd[1]: mariadb.service: Unit entered failed state.
Oct 02 19:26:18 nextcloudpi systemd[1]: mariadb.service: Failed with result 'exit-code'.

I’ve updated my response above, sorry for that.

I use NextcloudPi on my Raspberry Pi to run Nextcloud and flashed the image onto a MicroUSB. It worked like a charm for about half a year and sometimes gave me a 500 error, but restarting my Pi solved it. However, now the error is not “removable” so to speak. I hope I didn’t understand your question wrong :sweat_smile:

I was actually hoping to see more details about the issue, but there is nothing at all :frowning:

Can you please:

  • check that there is enough storage space for the database
  • increase the log level for mariaDB if there is enough space left
  • start mariaDB again (after log level increased)
  • send the logs

Hi Schmu,
long story short: the issue is fixed :heart_eyes:
The detailed version: (in case someone else has this issue)

  • In the MariaDB config file, I added the option
    log_error=/var/log/mysql/mariadb.err

  • When starting mariaDB again and examining this file, I noticed the following error:

    2019-10-03 10:16:00 1996099376 [Note] Recovering after a crash using tc.log
    2019-10-03 10:16:00 1996099376 [ERROR] Can’t init tc log
    2019-10-03 10:16:00 1996099376 [ERROR] Aborting

  • When I tried to open the file located in /var/lib/mysql/tc.log, I wasn’t able to do so, it seemed like the file was corrupt, so I went ahead and deleted it

  • And voilĂ  - it’s now starting perfectly fine!

Thank you very much for your help, you saved my day!

1 Like

Great news! I’m glad you were able to solve this issue! :slight_smile: