[SOLVED] Nextcloud 22.2.5.2 - blank page / error 500 after upgrade - (ReconnectWrapper php 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, 20.0.5): 22.2.5.1
Operating system and version (eg, Ubuntu 20.04): Debian 11 Bullseye / Raspbian OS 32bit
Apache or nginx version (eg, Apache 2.4.25): apache2-bin/stable,now 2.4.52-1
PHP version (eg, 7.4): php8.0-common/now 8.0.16-1

The issue you are facing:
After upgrade to NC 22.2.5.1 I get a blank page in the webinterface (error 500)

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

It happens every time trying to upgrade to NC 22.2.5.1 from NC 21.0.9.1

Steps to replicate it:

  1. Having a working Nextcloud 21.0.9.1 installation and want to upgrade to Nextcloud 22.2.5.1
    root@germanicus:/var/www/nextcloud# sudo -u www-data php8.0 -f status.php

  2. Doing a backup of the database, the database folder (BASE), the data folder (DATA) - and doing a fullbackup of the server

  3. Terminating all clients that could sync with the nextcloud during the upgrade

  4. Disabling even the ports in the internet router, so that the nextcloud is no more available to the outside world and no bad guys can show up during the upgrade

  5. Deactivating the cron jobs for cron.php and preview generator

  6. Deactivating all the thirs party apps
    root@germanicus:/var/www/nextcloud# sudo -u www-data php occ app:list → list me the enabled apps, so that I can re-enabled afterwards

root@germanicus:/var/www/nextcloud# sudo -u www-data php occ app:disable bookmarks bruteforcesettings …

  1. Stopping the apache webserver

  2. Renaming the existing nextcloud folder in /var/www to “nextcloud_OLD” to have a backup and to save the config.php for later

  3. Downloading the Nextcloud 22.2.5.1 zip file to /tmp from the Nextcloud website

  4. Extracting the zip file and move the new folder “nextcloud” it to /var/www

  5. Restoring the config.php from nextcloud_OLD folder (previous NC 21 installation)

  6. Removing the CAN_INSTALL file from /var/www/nextcloud/config folder

  7. Identifying the apps from the old folder which need to be saved back to the new installation folder
    root@germanicus:/var/www# diff -u <(ls nextcloud_OLD/apps/) <(ls nextcloud/apps/) | grep “-”

Verifying that the apps are available for NC 22 and copy the folders in the new nextcloud/apps folder

  1. Setting the correct files and folder permissions:
    root@germanicus:/var/www# chown -R www-data:www-data nextcloud
    root@germanicus:/var/www# find nextcloud/ -type d -exec chmod 750 {} ;
    root@germanicus:/var/www# find nextcloud/ -type f -exec chmod 640 {} ;

  2. As I have my data folder on /opt/nextcloud/DATA and not in /var/www/nextcloud/data, I am doing the following and create a symbolic link:

root@germanicus:/var/www# mv nextcloud/data nextcloud/data_NEIN
root@germanicus:/var/www# ln -s /opt/nextcloud/DATA /var/www/nextcloud/data
root@germanicus:/var/www# ls -lah nextcloud/data
lrwxrwxrwx 1 root root 19 Feb 27 09:57 nextcloud/data → /opt/nextcloud/DATA
root@germanicus:/var/www# chown -h www-data:www-data nextcloud/data
root@germanicus:/var/www# ls -lah nextcloud/data
lrwxrwxrwx 1 www-data www-data 19 Feb 27 10:04 nextcloud/data → /opt/nextcloud/DATA
root@germanicus:/var/www#

  1. Starting the webserver apache

  2. Upgrading the Nextcloud on command line
    root@germanicus:/var/www/nextcloud# sudo -u www-data php occ upgrade
    Nextcloud or one of the apps require upgrade - only a limited number of commands are available
    You may use your browser or the occ upgrade command to do the upgrade
    Setting log level to debug
    Turned on maintenance mode
    Updating database schema
    Updated database

    Starting code integrity check…
    Finished code integrity check
    Update successful
    Turned off maintenance mode
    Resetting log level

  3. Verifying that everything has been installed successfully:
    root@germanicus:/var/www/nextcloud# sudo -u www-data php occ upgrade
    Nextcloud is already latest version
    root@germanicus:/var/www/nextcloud# sudo -u www-data php occ status

  • installed: true
  • version: 22.2.5.1
  • versionstring: 22.2.5
  • edition:
    root@germanicus:/var/www/nextcloud#
  1. Upgrading all the currently enabled apps:

root@germanicus:/var/www/nextcloud# sudo -u www-data php occ app:update --all

  1. Re-enable the third party apps:

All apps, except the theming app, can be enabled:

root@germanicus:/var/www/nextcloud# sudo -u www-data php occ app:enable bookmarks bruteforcesettings…

root@germanicus:/var/www/nextcloud# sudo -u www-data php occ app:enable theming
App “Theming” cannot be installed because it is not compatible with this version of the server.
root@germanicus:/var/www/nextcloud#

OK, so I deleted the theming folder, and used the default one of the NC 22 zip file.

Then I could proceed (enabling theming, upgrading theming)

  1. Launching the web-interface over external (https://foo.ddns.net) & internal IP (https://192.168.200.4) - Internal Server error appears :frowning:

https://food.ddns.net:

image

https://192.168.200.4 - Untrusted domain

image

  1. Running a manual cron.php to re-read the settings from config.php

root@germanicus:/var/www/nextcloud# sudo -u www-data php -f /var/www/nextcloud/cron.php
root@germanicus:/var/www/nextcloud#

No errors here in /var/mail/www-data or in /var/log/syslog

  1. Rebooting the whole server

  2. After a reboot both links, internal and external, deliver a white blank page. There is even no more “Internal Server error” message. Only a blank page.

The Let’s encrypt certificate is working fine and shows “Connection secure”

image

All other sites and services running on the server like

https://foo.ddns.net/gotify

are working fine - so it is not related to the certificate.

The output of your Nextcloud log in Admin > Logging:

There are only logs related to the issue, only previewgenerator and "fixOrientation"

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

<?php
$CONFIG = array (
  'instanceid' => 'oceru6sviz2u',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => '192.168.200.4',
    1 => 'foo.ddns.net',
  ),
  'datadirectory' => '/opt/nextcloud/DATA',
  'tempdirectory' => '/opt/nextcloud/DATA/TEMP_UPLOAD',
  'dbtype' => 'mysql',
  'version' => '22.2.5.1',
  'overwrite.cli.url' => 'https://foo.ddns.net',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => 'true',
  'maintenance' => false,
  'ldapIgnoreNamingRules' => 'false',
  'loglevel' => 3,
  'log_type' => 'file',
  'logfile' => '/opt/nextcloud/DATA/nextcloud.log',
  'default_phone_region' => 'DE',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => '0',
    'timeout' => '0.0',
    'password' => 'xxx',
  ),
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'data-fingerprint' => 'xxx',
  'defaultapp' => 'spreed,files',
  'default_language' => 'de',
  'app_install_overwrite' => 
  array (
    0 => 'previewgenerator',
  ),
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
);

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

root@germanicus:/var/www/nextcloud# cat /var/log/apache2/error.log
[Tue Mar 01 00:00:01.018823 2022] [mpm_event:notice] [pid 790:tid 3066233280] AH00489: Apache/2.4.52 (Raspbian) mod_fcgid/2.3.9 OpenSSL/1.1.1k configured -- resuming normal operations
[Tue Mar 01 00:00:01.018906 2022] [core:notice] [pid 790:tid 3066233280] AH00094: Command line: '/usr/sbin/apache2'
[Tue Mar 01 00:31:05.057847 2022] [mpm_event:notice] [pid 790:tid 3066233280] AH00492: caught SIGWINCH, shutting down gracefully
[Tue Mar 01 00:37:44.227051 2022] [mpm_event:notice] [pid 18404:tid 3066393024] AH00489: Apache/2.4.52 (Raspbian) mod_fcgid/2.3.9 OpenSSL/1.1.1k configured -- resuming normal operations
[Tue Mar 01 00:37:44.227514 2022] [core:notice] [pid 18404:tid 3066393024] AH00094: Command line: '/usr/sbin/apache2'
[Tue Mar 01 09:21:17.396587 2022] [mpm_event:notice] [pid 18404:tid 3066393024] AH00492: caught SIGWINCH, shutting down gracefully
[Tue Mar 01 09:21:17.595903 2022] [mpm_event:notice] [pid 25809:tid 3065999808] AH00489: Apache/2.4.52 (Raspbian) mod_fcgid/2.3.9 OpenSSL/1.1.1k configured -- resuming normal operations
[Tue Mar 01 09:21:17.596364 2022] [core:notice] [pid 25809:tid 3065999808] AH00094: Command line: '/usr/sbin/apache2'
[Tue Mar 01 09:21:51.268410 2022] [mpm_event:notice] [pid 25809:tid 3065999808] AH00492: caught SIGWINCH, shutting down gracefully
[Tue Mar 01 09:21:51.475946 2022] [mpm_event:notice] [pid 25935:tid 3066659264] AH00489: Apache/2.4.52 (Raspbian) mod_fcgid/2.3.9 OpenSSL/1.1.1k configured -- resuming normal operations
[Tue Mar 01 09:21:51.476396 2022] [core:notice] [pid 25935:tid 3066659264] AH00094: Command line: '/usr/sbin/apache2'
root@germanicus:/var/www/nextcloud# 



cat /var/log/apache/nc-error.log:

[proxy_fcgi:error] [pid 13156:tid 2658124800] [client 192.168.200.4:44664] AH01071: Got error 
'PHP message: PHP Warning:  
include(/var/www/nextcloud/lib/composer/composer/../../../lib/private/DB/ReconnectWrapper.php): 
Failed to open stream: No such file or directory in /var/www/nextcloud/lib/composer/composer/ClassLoader.php on line 480

PHP message: PHP Warning:
include(): Failed opening '/var/www/nextcloud/lib/composer/composer/../../../lib/private/DB/ReconnectWrapper.php' 
for inclusion 
(include_path='/var/www/nextcloud/3rdparty/pear/archive_tar:
/var/www/nextcloud/3rdparty/pear/console_getopt:
/var/www/nextcloud/3rdparty/pear/pear-core-minimal/src:
/var/www/nextcloud/3rdparty/pear/pear_exception:/var/www/nextcloud/apps') 

in /var/www/nextcloud/lib/composer/composer/ClassLoader.php on line 480
PHP message: PHP Fatal error:  Uncaught Error: Class "OC\\DB\\ReconnectWrapper" 

not found in /var/www/nextcloud/lib/private/DB/Connection.php:56
\nStack trace:
\n#0 /var/www/nextcloud/lib/composer/composer/ClassLoader.php(480): include()
\n#1 /var/www/nextcloud/lib/composer/composer/ClassLoader.php(346): Composer\\Autoload\\includeFile()
\n#2 [internal function]: Composer\\Autoload\\ClassLoader->loadClass()
\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/DriverManager.php(214): is_subclass_of()
\n#4 /var/www/nextcloud/lib/private/DB/ConnectionFactory.php(159): Doctrine\\DBAL\\DriverManager::getConnection()
\n#5 /var/www/nextcloud/lib/private/Server.php(835): OC\\DB\\ConnectionFactory->getConnection()
\n#6 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\\Server->OC\\{closure}()
\n#7 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()
\n#8 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleCo...'

What I have found so far is, that the ReconnectWrapper.php has been deleted in Nextcloud 22:

The questions are:

  1. Why do these error messages in nc-error.log appear?

  2. Are the ReconnectWrapper issues related to my blank page issue?

If you need an overview about my active php and apache modules, please let me know.

IN SHORT: apache2 uses proxy_fcgi Module (+proxy Module) to talk with PHP FPM 8.0

EDIT:
In step 15, I rename the /var/www/nextcloud/data folder and link to my existing folder /opt/nextcloud/DATA.

I discovered, that the data folder contains a “owncloud.db” file which does not exist in /opt/nextcloud/DATA

How “mandatory” is this owncloud.db file? Which information does it host? My nextcloud database is in /opt/nextcloud/BASE. Is owncloud.db just a dummy file in case you don’t have a fully running database?

The problem was related to a bad PHP configuration.

By uninstalling all PHP packages - WITHOUT deleting the configuration, I finally got a “Internal Server error” once again.

By reinstalling the PHP packages, I had the blank screen again.

So I backuped all the PHP settings in /etc/php/8.0 → /etc/php/8.0_BACKUP (doing a cp -r)

Afterwards I did an apt remove and an apt purge so that all php settings have been deleted, too.

Afterwards, I startetd “from scratch” with the PHP re-configuration.

This guide was helpful:

Afterwards, I consulted the Nextcloud latest docs to enable the PHP modules + apache settings (a2enmod) once again:

https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html