[SOLVED] Internal Server Error on Updating NextCloud to 17.0.1

Nextcloud version: 17.0.1 (As per Version.php $OC_VersionString = ‘17.0.1’; )
Operating system and version: Ubuntu 19.10
Apache: Apache/2.4.41 (Ubuntu)
PHP version (eg, 7.1): 7.2.24
Note (phpinfo(); shows Ubuntu 19.04 even though I have now updated it to 19.10)

The issue you are facing:
I updated my NextCloud instance to latest version and also updated my Ubuntu from 19.04 to 19.10.
Post that update I faced “Internal Server Error” when trying to visit my Nextcloud instance from Browser. After much of searching online, I realised that it was something to do with my Caching. So I disabled redis caching that was on my nextcloud/config/Config.php

‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘redis’ => [
‘host’ => ‘localhost’,
‘port’ => 6379,
],

Then my website was loading properly.

I then proceeded to reconfigure my memcache based on documentation provided here https://docs.nextcloud.com/server/15/admin_manual/configuration_server/caching_configuration.html
However, I was getting the same error “Internal Server Error” again. So I decided to just use APCU. So i reconfigured my config.php to this

// ‘memcache.local’ => ‘\OC\Memcache\Redis’,
//‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
//‘memcache.locking’ => ‘\OC\Memcache\Redis’,
//‘redis’ => [
// ‘host’ => ‘localhost’,
// ‘port’ => 6379,
//],
//Above lines (redis memcache) are commented for testing APCu below
//
‘memcache.local’ => ‘\OC\Memcache\APCu’,

However, the error persisted. So I removed all the lines including the commented ones.
Now my config file looks like this

<?php
$CONFIG = array (
'instanceid' => 'CONFIDENTIAL',
'passwordsalt' => 'CONFIDENTIAL',
'secret' => 'CONFIDENTIAL',
'trusted_domains' =>
array (
  0 => 'INTERNAL-IP',
  1 => 'cloud.mihirsolanki.in',
),
'datadirectory' => '/home/mhrsolanki2020/SolankiCloudData/',
'dbtype' => 'mysql',
'version' => '17.0.1.1',
'overwrite.cli.url' => 'http://cloud.mihirsolanki.in/SolankiCloud',
'dbname' => 'CONFIDENTIAL',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'CONFIDENTIAL',
'mysql.utf8mb4' => true,
'dbuser' => 'CONFIDENTIAL',
'dbpassword' => 'CONFIDENTIAL',
'installed' => true,
'htaccess.RewriteBase' => '/',
'twofactor_enforced' => 'false',
'twofactor_enforced_groups' =>
array (
  0 => 'admin',
),
'twofactor_enforced_excluded_groups' =>
array (
),

'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'ssl',
'mail_sendmailmode' => 'smtp',
'mail_from_address' => 'CONFIDENTIAL',
'mail_domain' => 'mihirsolanki.in',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => 1,
'mail_smtphost' => 'CONFIDENTIAL',
'mail_smtpport' => 'CONFIDENTIAL',
'mail_smtpname' => 'CONFIDENTIAL',
'mail_smtppassword' => 'CONFIDENTIAL',
'maintenance' => false,
'updater.secret' => 'CONFIDENTIAL',
'theme' => '',
'loglevel' => 2,
);

Now after deleting those lines, the webpage is just blank.

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

Steps to replicate it:

  1. Update ubuntu from 19.04 to 19.10
  2. Update NextCloud to latest version
  3. Try accessing NextCloud from Broswer

The output of your Nextcloud log in Admin > Logging:

Logging is 'loglevel' => 2

(According to https://docs.nextcloud.com/server/17/admin_manual/configuration_server/logging_configuration.html it is at "WARN" level)

The output of your Apache/var/log/apache2:
How i Extracted the logs :`
Step1: I stopped the apache server
Step 2: I moved these 3 files to a backup folder

1. errors.log
2. access.log
3. other_vhosts_access.log

Step 3: I started my apache server
Step 4: I accessed my website (nextcloud instance)
Step 5: Stopped my apache server
Step 6: Copied the three log files

errors.log

[Sat Nov 30 13:25:32.423013 2019] [mpm_prefork:notice] [pid 3949] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1c configured -- resuming normal operations
[Sat Nov 30 13:25:32.423190 2019] [core:notice] [pid 3949] AH00094: Command line: '/usr/sbin/apache2'
[Sat Nov 30 13:25:41.672934 2019] [mpm_prefork:notice] [pid 3949] AH00169: caught SIGTERM, shutting down

access.log

EMPTY

other_vhosts_access.log

cloud.mihirsolanki.in:443 183.87.41.84 - - [30/Nov/2019:13:25:38 +0530] "GET / HTTP/1.1" 500 4179 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"

Update 1:
As suggested by j-ed in the answer below, I tried enabling the redis cache again by inserting the following lines in my code

 'memcache.local' => '\OC\Memcache\APCu',
  'memcache.distributed' => '\OC\Memcache\Redis',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => [
	'host' => 'localhost',
	'port' => 6379,
	],

However, there are no changes in logs. I am getting the same logs as noted above.

I would recommend to enable caching again and find out why you’re running into trouble with your Redis server. Once this problem has been solved Nextcloud will most likely work again.

Hi j-ed,
I tried it. Getting same log output as before. No change. (Updated the response in the Original Thread above)
Am I looking at wrong logs?
I intentionally made a mistake in config.php to check what error I get. I got “check your webserver log” . Once I rectified the intentional mistake the error changed to “check your server log”.

I am not sure whether server logs and webserver logs are one and the same thing?

By default the Nextcloud log file should be created in your data directory(/home/mhrsolanki2020/SolankiCloudData/). BTW, you should set the ‘loglevel’ => 0, to enable debug logging.

1 Like

Hi j-ed,
Thankyou for pointing me in correct direction. I was looking at wrong logs for debugging the issue.

To point out what actually happened and what the solution was, please read the following:

When updating ubuntu and nextcloud, some how my php modules in /etc/php7.2/mods-available were carried over to /etc/php7.3/mods-available/
This includes Redis and APCu modules as well.
However, Apache2 was still using php-7.2 (with missing packages) and not php-7.3.
The error in my nextcloud.log was “APCu not available for local cache” and hint was “Is the matching PHP module installed and enabled?”

sudo a2dismod php7.2
sudo a2enmod php7.3
sudo systemctl restart apache2

So to resolve this I disabled PHP-7.2 and enabled PHP-7.3 and voila! It is working now.

1 Like