Internal server error after PHP update on ubuntu 22.04 LTS server

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, 20.0.5): 25.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04LTS
Apache or nginx version (eg, Apache 2.4.25): nginx 1.18.0
PHP version (eg, 7.4): 8.0

The issue you are facing:

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

Steps to replicate it:

  1. Run apt update && apt upgrade -y
  2. PHP 8.0 updated
  3. Cannot open nextcloud web server. Showing “internal server error”

The output of your Nextcloud log in Admin > Logging:

Error	cron	RedisException: Connection refused		2022-11-17T17:48:21-0800
Error	remote	RedisException: Connection refused		2022-11-17T17:46:11-0800
Error	cron	RedisException: Connection refused		2022-11-17T17:45:01-0800
Error	no app in context	OCP\AppFramework\QueryException: Could not resolve externalMountProvider! Class "externalMountProvider" does not exist		2022-11-17T17:44:07-0800
Error	no app in context	OCP\AppFramework\QueryException: Could not resolve OCA\Files_Versions\Versions\IVersionManager! Class can not be instantiated		2022-11-17T17:44:07-0800
Error	no app in context	OCP\AppFramework\QueryException: Could not resolve trashManager! Class "trashManager" does not exist		2022-11-17T17:44:07-0800
Error	index	RedisException: Connection refused

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

<?php
$CONFIG = array (
  'trusted_proxies' =>
  array (
    0 => 'xx4',
    1 => 'xx2',
  ),
  'instanceid' => 'xxa',
  'passwordsalt' => 'xxF',
  'secret' => 'xxI',
  'trusted_domains' =>
  array (
    0 => 'xx.com',
    1 => 'xx2',
  ),
  'datadirectory' => '/mnt/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '25.0.1.1',
  'overwrite.cli.url' => 'https://xxe.com',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxser',
  'dbpassword' => 'xx4',
  'installed' => true,
  'default_phone_region' => 'US',
  'trashbin_retention_obligation' => 'auto,60',
  'maintenance' => false,
  'loglevel' => 2,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => [
       'host' => 'localhost',
       'port' => 6379,
  ],
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'cloud',
  'mail_domain' => 'txxxe.com',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'mxxx.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'xxxom',
  'mail_smtppassword' => '4xxxxx3',
  'theme' => '',
  'onlyoffice' =>
  array (
    'verify_peer_off' => true,
  ),
  'app_install_overwrite' =>
  array (
    0 => 'documentserver_community',
    'allow_local_remote_servers' => true,
  ),
  'allow_local_remote_servers' => true,
  'updater.release.channel' => 'stable',
);

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

2022/11/17 17:44:18 [error] 3596#3596: *21 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class "OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin" not found in /var/www/nextcloud/remote.php:62
Stack trace:
#0 /var/www/nextcloud/remote.php(173): handleException()
#1 {main}
  thrown in /var/www/nextcloud/remote.php on line 62" while reading response header from upstream, client: 192.168.xx.yy, server: cloudx.com, request: "PROPFIND /remote.php/dav/files/client/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: ".com"
2022/11/17 17:44:21 [error] 3596#3596: *22 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class "OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin" not found in /var/www/nextcloud/remote.php:62
Stack trace:
#0 /var/www/nextcloud/remote.php(173): handleException()
#1 {main}
  thrown in /var/www/nextcloud/remote.php on line 62" while reading response header from upstream, client: 192.168.xx.yy, server: .com, request: "PROPFIND /remote.php/dav/files/client/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: ".com"
2022/11/17 17:44:39 [error] 3596#3596: *19 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class "OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin" not found in /var/www/nextcloud/remote.php:62
Stack trace:
#0 /var/www/nextcloud/remote.php(173): handleException()
#1 {main}
  thrown in /var/www/nextcloud/remote.php on line 62" while reading response header from upstream, client: 192.168.xx.yy, server: .com, request: "PROPFIND /remote.php/dav/files/client/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: ".com"
2022/11/17 17:45:09 [error] 3596#3596: *28 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class "OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin" not found in /var/www/nextcloud/remote.php:62
Stack trace:
#0 /var/www/nextcloud/remote.php(173): handleException()
#1 {main}
  thrown in /var/www/nextcloud/remote.php on line 62" while reading response header from upstream, client: 192.168.xx.yy, server: .com, request: "PROPFIND /remote.php/dav/files/client/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: ".com"

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

I am happy to see you anonymized the config file. Unfortunately I can see both IP adresses and domains from your pasted logfile output. :frowning:

Further observations:

  1. No error when switching to php 7.4, keeping all config files unchanged.
  2. Previously no error running on php 8.0, before most recent “apt upgrade”.
  3. Redis-server failed to start.
  4. No error running on php 8.0, 8.1 when Redis memory cache statements were removed from config.php.

Conclusion: failure of redis-server after recent “apt upgrade”. Redis-server failed to start despite re-installation of the Ubuntu 22.04 package or the redislabs package.

Final solution: web search revealed that owner/permission of /var/lib/redis, /var/log/redis, /var/run/redis folders was messed up (? by apt install) causing failure of redis-server startup through systemd. Change ownership of these folders to redis:redis solved the problem. Now nextcloud runs fine with PHP 8.0/8.1 and redis memory caching enabled.