Permanent error in the error log Error: count(): Parameter must be an array or an object that implements Countable at /usr/share/nginx/html/nextcloud/lib/private/Memcache/Redis.php#88

Hello.
I constantly see the same error in my journal
Error: count(): Parameter must be an array or an object that implements Countable at /usr/share/nginx/html/nextcloud/lib/private/Memcache/Redis.php#88
<>

OC\Log\ErrorHandler::onError()

/usr/share/nginx/html/nextcloud/lib/private/Memcache/Redis.php - line 88:

count()

/usr/share/nginx/html/nextcloud/lib/private/App/AppManager.php - line 456:

OC\Memcache\Redis->clear()

/usr/share/nginx/html/nextcloud/lib/private/legacy/OC_App.php - line 916:

OC\App\AppManager->clearAppsCache()

/usr/share/nginx/html/nextcloud/lib/private/Installer.php - line 205:

OC_App::updateApp("*** sensiti … *")

/usr/share/nginx/html/nextcloud/apps/settings/lib/Controller/AppSettingsController.php - line 531:

OC\Installer->updateAppstoreApp("*** sensiti … *")

/usr/share/nginx/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 170:

OCA\Settings\Controller\AppSettingsController->updateApp("*** sensiti … *")

/usr/share/nginx/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 100:

OC\AppFramework\Http\Dispatcher->executeController()

/usr/share/nginx/html/nextcloud/lib/private/AppFramework/App.php - line 137:

OC\AppFramework\Http\Dispatcher->dispatch()

/usr/share/nginx/html/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:

OC\AppFramework\App::main()

<>

OC\AppFramework\Routing\RouteActionHandler->__invoke()

/usr/share/nginx/html/nextcloud/lib/private/Route/Router.php - line 297:

call_user_func()

/usr/share/nginx/html/nextcloud/lib/base.php - line 1011:

OC\Route\Router->match()

/usr/share/nginx/html/nextcloud/index.php - line 37:

OC::handleRequest()

This error has appeared since version 18. Currently, version 19.0.4 is installed
OS Centos 8
nginx 1.19.0
php 7.4.8

I did not find anything like it on the forums. What thoughts are there? thanks

Please show us the content of your Nextcloud configuration file.

#<?php
$CONFIG = array (
‘instanceid’ => ‘AAAAAA’,
‘passwordsalt’ => ‘AAAAAA’,
‘secret’ => ‘AAAAAAA’,
‘trusted_domains’ =>
array (
0 => ‘cloud.mydomain.ru’,
1 => ‘XX.XX.XX.XX’,
2 => ‘YY.YY.YY.YY’,
),
‘datadirectory’ => ‘/home/nextcloud’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘19.0.4.2’,
‘overwrite.cli.url’ => ‘https://cloud.mydomain.ru’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘mysql.utf8mb4’ => true,
‘dbuser’ => ‘usercloud’,
‘dbpassword’ => ‘AAAAAAA’,
‘installed’ => true,
‘mail_smtpmode’ => ‘smtp’,
‘mail_sendmailmode’ => ‘smtp’,
‘mail_from_address’ => ‘nextcloud’,
‘mail_smtpauthtype’ => ‘LOGIN’,
‘mail_smtpauth’ => 1,
‘mail_domain’ => 'mydomain.ru,
‘mail_smtphost’ => ‘mail.mydomain.ru’,
‘mail_smtpport’ => ‘465’,
‘mail_smtpname’ => 'nextcloud@mydomain.ru,
‘mail_smtppassword’ => ‘AAAAAAA’,
‘mail_smtpsecure’ => ‘ssl’,
‘default_language’ => ‘ru’,
‘force_language’ => ‘ru’,
‘default_locale’ => ‘ru_RU’,
‘force_locale’ => ‘ru_RU’,
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘maintenance’ => false,
‘theme’ => ‘’,
‘loglevel’ => 2,
‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘redis’ =>
array (
‘host’ => ‘127.0.0.1’,
‘port’ => 6379,
‘dbindex’ => 0,
‘password’ => ‘AAAAAAAAA’,
‘timeout’ => 1.5,
),
‘onlyoffice’ =>
array (
‘verify_peer_off’ => true,
),
‘twofactor_enforced’ => ‘true’,
‘twofactor_enforced_groups’ =>
array (
0 => ‘admin’,
),
‘twofactor_enforced_excluded_groups’ =>
array (
0 => ‘Marketing’,
1 => ‘Sales_HCC’,
2 => ‘IT’,
),
‘app_install_overwrite’ =>
array (
0 => ‘drawio’,
),
);

Replaced only the identification data in the presented config.

Is there any reason why you’ve set the parameter ‘memcache.distributed’? For a local installation the parameters should look like this. BTW, using the Redis socket is much faster and doesn’t rely on the loopback network interface but requires the socket ownership to be set correctly:

  'memcache.locking' => 'OC\\Memcache\\Redis',
  'redis' => array (
    'host' => '/run/redis.sock',
    'port' => 0,
    'password' => '<password>',
    'timeout' => 0.0,
  ),

When using the ‘memcache.locking’ parameter, I get a lot of errors. more details in the picture.

Yes you are right it is better to use unixsocket.I set up the server according to the manual, that’s why the ‘memcache.distributed’ parameter was used, in which only the error is described in the topic.

At the moment, reconfigured according to this config.

‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘redis’ => [
‘host’ => ‘/run/redis/redis-server.sock’,
‘port’ => 0,
‘dbindex’ => 0,
‘password’ => ‘secret’,
‘timeout’ => 1.5,
],

Error: count (): Parameter must be an array or an object that implements Countable at /usr/share/nginx/html/nextcloud/lib/private/Memcache/Redis.php#88
is kept for now.
I noticed that it appears when installing applications.

I have been using nextcloud not so long ago, maybe I haven’t figured it out yet.

ps: Sorry for poor English, this is not my main language.