Nextcloudpi - Nextcloud Update 21.0.4 to 22.2.2 fails

Hi,

I am trying to update nextcloud via ncp-web from 21.0.4 to 22.2.2 but the installation always fails, even after restarting the device.

I am running NextcloudPi v1.44.4 on RaspberryPi 4 / 4GB.

I really don’t understand this #22 in the log, but maybe you can help:

[ nc-update-nextcloud ] (Sun Nov 21 21:15:02 CET 2021)
Current Nextcloud version 21.0.4.1
Available Nextcloud version 22.2.2
Download Nextcloud 22.2.2…
Back up current instance…
check free space…
Maintenance mode enabled
backup database…
backup files…
backup /var/www//nextcloud-bkp_20211121_1637525722.tar.gz generated
Maintenance mode disabled
Install Nextcloud 22.2.2…
Fix permissions…
Upgrade…
An unhandled exception has been thrown:
Exception: Redis cluster config is missing the “seeds” attribute in /var/www/nextcloud/lib/private/RedisFactory.php:86
Stack trace:
#0 /var/www/nextcloud/lib/private/RedisFactory.php(164): OC\RedisFactory->create()
#1 /var/www/nextcloud/lib/private/Memcache/Redis.php(43): OC\RedisFactory->getInstance()
#2 /var/www/nextcloud/lib/private/Memcache/Factory.php(115): OC\Memcache\Redis->__construct(‘f8ab8816a4f2f5f…’)
#3 /var/www/nextcloud/lib/private/Server.php(1065): OC\Memcache\Factory->createLocking(‘lock’)
#4 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC{closure}(Object(OC\Server))
#5 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(Pimple\Container))
#6 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet(‘OCP\Lock\ILocki…’)
#7 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query(‘OCP\Lock\ILocki…’, false)
#8 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query(‘OCP\Lock\ILocki…’)
#9 /var/www/nextcloud/lib/private/Server.php(2024): OC\AppFramework\Utility\SimpleContainer->get(‘OCP\Lock\ILocki…’)
#10 /var/www/nextcloud/lib/private/Files/View.php(118): OC\Server->getLockingProvider()
#11 /var/www/nextcloud/lib/private/Server.php(435): OC\Files\View->__construct()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC{closure}(Object(OC\Server))
#13 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(Object(Pimple\Container))
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet(‘OC\Files\Node\H…’)
#15 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query(‘OC\Files\Node\H…’, false)
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query(‘OC\Files\Node\H…’)
#17 /var/www/nextcloud/lib/private/Server.php(1387): OC\AppFramework\Utility\SimpleContainer->get(‘OC\Files\Node\H…’)
#18 /var/www/nextcloud/lib/base.php(594): OC\Server->boot()
#19 /var/www/nextcloud/lib/base.php(1089): OC::init()
#20 /var/www/nextcloud/console.php(48): require_once(’/var/www/nextcl…’)
#21 /var/www/nextcloud/occ(11): require_once(’/var/www/nextcl…’)
#22 {main}Abort
Clean up…
Rolling back to backup /var/www/nextcloud-bkp_20211121_1637525722-21.0.4.1.tar.gz…
check free space…
extracting backup file /var/www/nextcloud-bkp_20211121_1637525722-21.0.4.1.tar.gz…

You just use a local redis on your setup or a real redis cluster?
Can you post your config.php?

Hi tflidd.
Thanks for your quick response.
I am using a local redis. I think so. I don’t know how to set up a redis cluster.

You can see my config.php below. I replaced all sensitive data with xxxx.

<?php
$CONFIG = array (
  'passwordsalt' => 'xxxx',
  'secret' => 'xxxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    11 => 'xxxx',
    1 => 'xxxx',
    5 => 'xxxx',
    7 => 'xxxx',
    8 => 'xxxx',
    3 => 'xxxx',
    2 => 'xxxx',
    12 => 'xxxx',
    14 => 'xxxx',
    '' => 'xxxx',
  ),
  'datadirectory' => 'xxxx',
  'dbtype' => 'mysql',
  'version' => '21.0.4.1',
  'overwrite.cli.url' => 'xxxx',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxx',
  'dbpassword' => 'xxxx',
  'installed' => true,
  'instanceid' => 'xxxx',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => 'xxxx',
  ),
  'tempdirectory' => '/media/ac5d11db-b3bf-4210-bc73-622f93eef8f2/ncdata/tmp',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'xxxx',
  'mail_domain' => 'xxxx',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'logfile' => '/media/ac5d11db-b3bf-4210-bc73-622f93eef8f2/ncdata/nextcloud.log',
  'loglevel' => '2',
  'log_type' => 'file',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => 'xxxx',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpsecure' => 'tls',
  'mail_smtpname' => 'xxxx',
  'mail_smtppassword' => 'xxxx',
  'htaccess.RewriteBase' => '/',
  'skeletondirectory' => '',
  'default_phone_region' => 'DE',
  0 =>
  array (
    11 => '127.0.0.1',
    12 => '::1',
    13 => 'xxxx',
    14 => '192.168.2.5',
  ),
  'trusted_proxies' =>
  array (
    0 => '127.0.0.1',
    1 => '::1',
  ),
  'data-fingerprint' => 'xxxx',
);

If this is a redis problem, should I switch to a different memory cache or is there any other possibility to fix this?

I disabled redis in config.php but the problem still remains. I found this thread where they have a similar issue, but I can’t solve it that way because in my RedisFactory.php the line $isCluster = in_array('redis.cluster', $this->config->getKeys()); does not exist, maybe it is because they are using a docker image. There are some mentions of a redis cluster in my case but I am not aware of php so I really don’t want to mess something up.

<?php
/**
 * @copyright Copyright (c) 2016, ownCloud, Inc.
 *
 * @author Alejandro Varela <epma01@gmail.com>
 * @author Christoph Wurst <christoph@winzerhof-wurst.at>
 * @author Jörn Friedrich Dreyer <jfd@butonic.de>
 * @author Morris Jobke <hey@morrisjobke.de>
 * @author Robin Appelman <robin@icewind.nl>
 * @author Robin McCorkell <robin@mccorkell.me.uk>
 *
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program. If not, see <http://www.gnu.org/licenses/>
 *
 */

namespace OC;

class RedisFactory {
        /** @var  \Redis */
        private $instance;

        /** @var  SystemConfig */
        private $config;

        /**
         * RedisFactory constructor.
         *
         * @param SystemConfig $config
         */
        public function __construct(SystemConfig $config) {
                $this->config = $config;
        }

        private function create() {
                if ($config = $this->config->getValue('redis.cluster', [])) {
                        if (!class_exists('RedisCluster')) {
                                throw new \Exception('Redis Cluster support is not available');
                        }
                        // cluster config
                        if (isset($config['timeout'])) {
                                $timeout = $config['timeout'];
                        } else {
                                $timeout = null;
                        }
                        if (isset($config['read_timeout'])) {
                                $readTimeout = $config['read_timeout'];
                        } else {
                                $readTimeout = null;
                        }
                        if (isset($config['password']) && $config['password'] !== '') {
                                $this->instance = new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout, false, $config['password']);
                        } else {
                                $this->instance = new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout);
                        }

                        if (isset($config['failover_mode'])) {
                                $this->instance->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, $config['failover_mode']);
                        }
                } else {
                        $this->instance = new \Redis();
                        $config = $this->config->getValue('redis', []);
                        if (isset($config['host'])) {
                                $host = $config['host'];
                        } else {
                                $host = '127.0.0.1';
                        }
                        if (isset($config['port'])) {
                                $port = $config['port'];
                        } elseif ($host[0] !== '/') {
                                $port = 6379;
                        } else {
                                $port = null;
                        }
                        if (isset($config['timeout'])) {
                                $timeout = $config['timeout'];
                        } else {
                                $timeout = 0.0; // unlimited
                        }

                        $this->instance->connect($host, $port, $timeout);
                        if (isset($config['password']) && $config['password'] !== '') {
                                $this->instance->auth($config['password']);
                        }

                        if (isset($config['dbindex'])) {
                                $this->instance->select($config['dbindex']);
                        }
                }
        }

        public function getInstance() {
                if (!$this->isAvailable()) {
                        throw new \Exception('Redis support is not available');
                }
                if (!$this->instance instanceof \Redis) {
                        $this->create();
                }

                return $this->instance;
        }

        public function isAvailable() {
                return extension_loaded('redis')
                && version_compare(phpversion('redis'), '2.2.5', '>=');
        }
}