Redis not working on fresh installation

installed new nextcloud 17.1.1 and cant got redis working configuration;

'installed' => true,
'filelocking.enabled' => true,
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
      'host' => '127.0.0.1',
     'port' => 6379,
     'timeout' => 0.5,

      ),
);

any ideas? is there something wrong with the configuration?

Redis status

● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2019-12-01 19:23:52 CET; 14min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 22752 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 22756 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited,
status=0/SUCCESS)
Main PID: 22778 (redis-server)
Tasks: 4 (limit: 4915)
CGroup: /system.slice/redis-server.service
└─22778 /usr/bin/redis-server 127.0.0.1:6379

PHP modules enabled

[PHP Modules]
apc
apcu
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
igbinary
imagick
imap
intl
json
ldap
libsmbclient
libxml
mbstring
memcached
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
pspell
readline
redis
Reflection
session
shmop
SimpleXML
smbclient
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Additional info

php-redis:
Installed: 5.0.2+4.3.0-2+ubuntu18.04.1+deb.sury.org+20191129
Candidate: 5.0.2+4.3.0-2+ubuntu18.04.1+deb.sury.org+20191129
Version table:
*** 5.0.2+4.3.0-2+ubuntu18.04.1+deb.sury.org+20191129 500
500 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
3.1.6-1build1 500

The Redis configuration for Nextcloud is looking fine.

  • Are you running Redis in a VM or container or on the same machine where the web server is running?
  • Are you using the correct PHP version on the server?
  • What are the errors being written to the Nextcloud log file?

To solve this on Ubuntu 18.04 LTS Do the following

‘sudo apt-get install redis-server’

Caution:

The installation process will fail, becaouse the redis.conf file comming with the deb package contains bind 127.0.0.1:1 see below…

After installation Installation has faild edit /etc/redis.conf

sudo nano /etc/redis/redis.conf

In line 69 change

bind 127.0.0.1 ::1 to bind 127.0.0.1

Change the port number to 0 and enable socket by chageing

#unixsocket ... unixsocket /var/run/redis/redis-server.sock

save the file

next reinstall redis server by useing

sudo apt-get -y install --reinstall redis-server && sudo service redis-server restart

than edit /pathtonextcloud/config/config.php to add redis cacheing

by useing

sudo nano /phaththonextcloud/config/config.php

‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘redis’ =>
array (
‘host’ => ‘/var/run/redis/redis-server.sock’,
‘port’ => 0,
‘timeout’ => 0.5,
‘dbindex’ => 0,
),

Finally check permission and gorup settings by useing

sudo chown -Rh redis:redis /var/run/redis 
sudo chmod 775 /var/run/redis *
usermod -a -G redis www-data

Thats it.

This is solveing it for Nextcloud x.x used on ubuntu 18.04 LTS and maybe beyond,because this is not a nextcloud bug. It’s just a lazy deb-package creator not willing to provide an updated deb package in ubuntus repositories. Sad but true.

Be aware that this solution is not taking in account that redis should be plugged in to nextcloud by useing a password. But this is a topic for an other thread.

Thanks to J ED for recognicing this. Sometiimes hands on and document it somewhere solves a problem more efficient than talking about it.

Stll wondering why this isn’t documented in the edmin manual. There are less information about that. Nextcloud VM github package uses the same fix but isn’t intended to be used on a vps or any external reachable server. So what’s the reason they don’t put it in to trouble shooting chapter or even the redis one. They know how to fix this.