Memcache Redis issue

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: 21.0.0
Operating system and version : CentOS 8
Apache or nginx version: Litespeed (Openlitespeed on CyberPanel)
PHP version: 7.4

The issue you are facing:

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

Steps to replicate it:

  1. I want to run NC on Redis and redis works well with other apps and CLI testings. However, something is wrong in config content.

  2. Everything works well if I run NC on Memcached

'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Memcached',
  1. But it not works with
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.distributed' => '\OC\Memcache\Redis',
'redis' => [
	'host' => 'localhost', 
	'port' => 6379,
	'timeout' => 2.0,
	'dbindex' => 0, 
],
  1. So, to be honest, for me is not clear what exactly is wrong. I tried also to replace ‘localhost’
    a) with exact same value of ‘trusted_domains’ (installation domain),
    b) with ’ /var/run/redis/redis-server.sock’,
    c) with ‘/tmp/redis.sock’

QUESTION

What is wrong here?

Pleaee provide DETAILED error messages from your Nextcloud log file if you try to access Redis. Without the error messages it won’t be possible to give you any advice.

Have you seen the official docs?
https://docs.nextcloud.com/server/21/admin_manual/configuration_server/caching_configuration.html?highlight=redis#id2

On my ubuntu system the config looks different

'memcache.locking' => '\\OC\\Memcache\\Redis',
'memcache.distributed' => '\OC\\Memcache\\Redis',

See the double backslashes and I was in the need to add a password.
The array syntax is different as well.

  1. I used syntax from config.sample.php.
  2. No problem to try with double backslashes, but how looks your array syntax?

Forget about my syntax comments. There are different ways to write arrays in php.
Use the official docs and troubleshoot your issue.