Out of the blue getting an "Internal Server Error message"

Out of the blue my nextcloud installation has stopped working. I have not made any changes in any of the setups. I see the following error:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

The nextcloud log under /var/www/html/nextcloud/data/nextcloud.log is empty.

I enabled 'debug' => true, but how do I view the debug output? How do I figure out what went wrong?

Nextcloud version (eg, 20.0.5): 26.0.8 
Operating system and version (eg, Ubuntu 20.04): Debian GNU/Linux 11 (bullseye)
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.56 (Debian)
PHP version (eg, 7.4): 8.2.13

The output of your Nextcloud log in Admin > Logging:

I cannot access the instance. 

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

<?php
$CONFIG = array (
  'instanceid' => 'ocb8hjqxvlv5',
  'passwordsalt' => 'XXX',
  'secret' => 'XXX',
  'trusted_domains' =>
  array (
    0 => '192.168.29.215',
  ),
  'datadirectory' => '/exthdd/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '26.0.8.2',
  'overwrite.cli.url' => 'http://192.168.29.215/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nxc',
  'dbpassword' => 'XXX',
  'installed' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'updater.secret' => 'XXX',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'debug' => true,
);

You should not set debug to true. You should read your logfiles instead.

You will find your nextcloud log in /exthdd/nextcloud/data/nextcloud.log
If it is empty, then you should set loglevel to 0

Then look in your apache error logfile, normaly located at /var/log/apache2/error.log

But most of the times that such an error occurs “out of the blue” it has something to do with a stopped service.

What is the echo of:

sudo systemctl --no-pager status apache2 mariadb redis php8.2-fpm

… and if it turns out that Redis isn’t running, for example, just restart it.

But then investigate the cause in the log files of that service, for example in the log file from redis etc.

Much luck,
ernolf

Thank you for that insight. I have managed to fix this error. Turns out I had memcache enabled in my setup, and even though Redis was running, it was not properly configured. I’ve since removed memcaching and everything works as expected now.

That confirms my suspicion, but then it probably didn’t happen “out of the blue” after all :wink:

Great!

Much luck,
ernolf

1 Like