Error 500 out of the sudden

Hi,

I have the problem that my Nextcloud is not accessible anymore out of the sudden. I can restore an ZFS-Snapshot and it works but after a time of doing nothing zap I cannot connect anymore. The Nextcloud Client tells me “500 Internal Server Error”.
What is the problem and how can I solve it?

Nextcloud version (eg, 12.0.2): 14.0.3
Operating system and version (eg, Ubuntu 17.04): Debian 9.4
Apache or nginx version (eg, Apache 2.4.25): Apache2 2.4.25
PHP version (eg, 7.1): 7.0 and 7.2

The issue you are facing:
Described above.

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

Steps to replicate it:

  1. restore an ZFS snapshot
  2. let NC run for a while
  3. no connection possible anymore

The output of your Nextcloud log in Admin > Logging:

If I cannot connect to Nextcloud, I cannot go to Admin > Logging :slight_smile: 

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

<?php
$CONFIG = array (
  'passwordsalt' => 'censored',
  'secret' => 'censored',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'censored',
    2 => 'censored',
  ),
  'datadirectory' => '/mnt/data',
  'overwrite.cli.url' => 'https://censored/nextcloud',
  'dbtype' => 'mysql',
  'version' => '14.0.3.0',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'censored',
  'installed' => true,
  'instanceid' => 'censored',
  'updater.release.channel' => 'stable',
  'maintenance' => false,
  'app.mail.transport' => 'php-mail',
  'theme' => '',
  'loglevel' => 2,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'enable_previews' => true,
  'preview_max_x' => 1024,
  'preview_max_filesize_image' => 50,
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\MP3',
    6 => 'OC\\Preview\\TXT',
    7 => 'OC\\Preview\\MarkDown',
    8 => 'OC\\Preview\\Illustrator',
    9 => 'OC\\Preview\\Photoshop',
    10 => 'OC\\Preview\\PDF',
    11 => 'OC\\Preview\\TIFF',
    12 => 'OC\\Preview\\SVG',
    13 => 'OC\\Preview\\Movie',
    14 => 'OC\\Preview\\MSOffice2007',
    15 => 'OC\\Preview\\MSOffice',
    16 => 'OC\\Preview\\Postscript',
    17 => 'OC\\Preview\\MSOfficeDoc',
    18 => 'OC\\Preview\\StarOffice',
    19 => 'OC\\Preview\\Font',
    20 => 'OC\\Preview\\Photoshop',
    21 => 'OC\\Preview\\OpenDocument',
    22 => 'OC\\Preview\\MSOfficeDoc',
  ),
);

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

A lot of this with increasing portnumbers:
[Mon Nov 26 11:39:38.695111 2018] [:error] [pid 471] [client xxx.xxx.xxx.xxx:57799] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: $

I think there is a problem with mariadb:
“ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 “No such file or directory”)”

Hi ! Can you post the Nextcloud.log ? When you get the 500 Error, should be a code like; A-AAA000XXX … , so look for this code in the Nextcloud.log and past here.

There’s nothing about this in the nextcloud.log. The last entry is from the 22nd. Over the weekend the server was shutdown.

I think there is a problem with mariadb/mysql. ““ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 “No such file or directory”)””

And if I run apt update I get:
“The following packages were automatically installed and are no longer required:
galera-3 libaio1 libdbi-perl libzip4 mariadb-client-core-10.1 mariadb-common mariadb-server-core-10.1 mysql-common php7.0-curl php7.0-gd php7.0-gmp php7.0-imap php7.0-intl php7.0-ldap php7.0-mbstring
php7.0-mysql php7.0-xml php7.0-zip socat”

The php7.0-stuff is because of my update to 7.2 I tried 5 minutes before to solve the problem.
but why is mariadb going to be removed??

“sudo service mysql status
Unit mysql.service could not be found.”

"sudo systemctl start mysqld
Failed to start mysqld.service: Unit mysqld.service not found.
"