Battling to get Redis working on Centos 7 with Nginx. I’ll keep going! This post is two years old but gives some kind of indication about what one needs to do.
Redis Support => enabled
Redis Version => 6.0.1
Redis Sentinel Version => 1.0
Available serializers => php, json, igbinary
Available compression => lzf, zstd, lz4
Directive => Local Value => Master Value
redis.arrays.algorithm => no value => no value
redis.arrays.auth => no value => no value
redis.arrays.autorehash => 0 => 0
redis.arrays.connecttimeout => 0 => 0
redis.arrays.distributor => no value => no value
redis.arrays.functions => no value => no value
redis.arrays.hosts => no value => no value
redis.arrays.index => 0 => 0
redis.arrays.lazyconnect => 0 => 0
redis.arrays.names => no value => no value
redis.arrays.pconnect => 0 => 0
redis.arrays.previous => no value => no value
redis.arrays.readtimeout => 0 => 0
redis.arrays.retryinterval => 0 => 0
redis.arrays.consistent => 0 => 0
redis.clusters.cache_slots => 0 => 0
redis.clusters.auth => no value => no value
redis.clusters.persistent => 0 => 0
redis.clusters.read_timeout => 0 => 0
redis.clusters.seeds => no value => no value
redis.clusters.timeout => 0 => 0
redis.pconnect.pooling_enabled => 1 => 1
redis.pconnect.connection_limit => 0 => 0
redis.pconnect.echo_check_liveness => 1 => 1
redis.pconnect.pool_detect_dirty => 0 => 0
redis.pconnect.pool_poll_timeout => 0 => 0
redis.pconnect.pool_pattern => no value => no value
redis.session.locking_enabled => 0 => 0
redis.session.lock_expire => 0 => 0
redis.session.lock_retries => 100 => 100
redis.session.lock_wait_time => 20000 => 20000
redis.session.early_refresh => 0 => 0
bind 127.0.0.1 ::1
protected-mode yes
port 0
tcp-backlog 511
unixsocket /var/run/redis/redis-server.sock
unixsocketperm 770
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /var/run/redis/redis-server.pid
loglevel notice
logfile /var/log/redis/redis-server.log
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
rdb-del-sync-files no
dir /var/lib/redis
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-diskless-load disabled
repl-disable-tcp-nodelay no
replica-priority 100
acllog-max-len 128
maxclients 512
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
lazyfree-lazy-user-del no
oom-score-adj no
oom-score-adj-values 0 200 800
appendonly no
appendfilename “appendonly.aof”
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events “”
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes
jemalloc-bg-thread yes
Sorry for the late reply, I compared your config and the php-redis package with my test server and everything seems to be identical. The only difference is that I have PHP 8.2 installed. In this context, you could check whether the active PHP version on your system and the php-redis package are on the same version.
Another reason for the internal server error could be some app that is not compatible with Redis. However, I can’t think of any specific app that is known for this, so I’m not sure.
I went back to my config.php to uncomment the lines regarding redis to then check the logs.
The few lines were gone, not even commented, just gone.
So i put them again (without the #) to load the 500 error.
But when i came back to my instance, i could access it and no more message regarding redis in administration panel.
Really weird.
So i guess my problem is solved.
Thanks guys for the help
@grosJambon33000@bb77 I’m on a similar system and am getting an Internal Server error when activating Redis for ‘memcache.distributed’. My config file:
Furthermore I get the following errors in the admin log:
[PHP] Error: RedisException: No such file or directory at /var/www/nextcloud/lib/private/RedisFactory.php#137
PUT /ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json
from 185.65.135.192 by Linus at 2023-11-06T21:57:17+00:00
RedisException: No such file or directory
RedisException: Redis server went away
...
I can also add that I’m migrating from a ncp instance to a manual installation. Any ideas why Redis would be crashing for some user_status api call?
I recently setup a new NC instance, this is my fifth instance in two years and this is the first time I’ve ever seen this error occur.
I am using the following:
Server: Ubuntu 22.04.3
NC version: 28.0.1
Apache2: 2.4.52
PHP version: 8.1.2
Whenever I uncomment 'memcache.distributed' => '\OC\Memcache\Redis',, I get the exact same error as the OP. I have followed everything in post 5 and in post 11 and I still get the same error. As soon as I comment it out again, access is restored.
Within my logs, I see the following odd errors that I’ve never seen before.
PHP error RedisException: No such file or directory at /var/www/nextcloud/lib/private/RedisFactory.php#117
and
Index error RedisException No such file or directory
and
Core error RedisException No such file or directory Exception thrown: RedisException
and
Core error RedisException Redis server went away Exception thrown: RedisException
All above errors always occur in unison.
I’m trying to get this setup for a small business owner that wanted it done before the holidays, so any and all help and recommendations are greatly appreciated.
bind 127.0.0.1 ::1
protected-mode yes
port 0
tcp-backlog 511
unixsocket /var/run/redis/redis-server.sock
unixsocketperm 770
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /var/run/redis/redis-server.pid
loglevel notice
logfile /var/log/redis/redis-server.log
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
rdb-del-sync-files no
dir /var/lib/redis
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-diskless-load disabled
repl-disable-tcp-nodelay no
replica-priority 100
acllog-max-len 128
maxclients 512
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
lazyfree-lazy-user-del no
oom-score-adj no
oom-score-adj-values 0 200 800
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes
jemalloc-bg-thread yes
The tail of /etc/redis/redis.conf) echos awk: fatal: cannot open file `/etc/redis/redis.conf' for reading: Permission denied. It’s the same message with and without sudo privileges. For what it’s worth, the final 10 lines of the redis config file are all commented out.
sudo apachectl -tD DUMP_INCLUDES 2>/dev/null | grep -v sites | sed -n '/php.*conf/ s#.*/\([^/]*\)\.conf#\1#p' That echos php8.1-fpm as I’d expect.
Last, but not least, your final echo request returns /etc/php/8.1/mods-available/redis.ini:extension=redis.so.
I’m certainly no expert in this, but most of that seems to be the results that I expected. The only odd result to me is the permission denied. I don’t know if it’s worth anything, but /etc/redis is owned by root with 755 permissions and /etc/redis/redis.conf is owned by redis with 640 permissions. The latter of which seem a bit odd to me. Then again, the only thing I know about redis is from the NC documentation.
Out of annoyance and some frustration, I deleted my NC and data folders and started again. I even copied the exact same config.php file that I’d copied previously (which came from an older successful install) for the above referenced install and changed all the relevant information. I even compared the two side by side and I couldn’t figure out what the difference was between them. I’m honestly at a loss to understand why it didn’t work the first time and does now.
That way your redis server will never start by the systemd mechanism.
It should be
supervised auto
or simply be commented out, since that is the default.
I did not ask for the tail of /etc/redis/redis.conf. I asked for the echo of
wich is the tail of the last 50 lines of the result of
awk '/logfile/ {print $NF}' /etc/redis/redis.conf
in other words, it should give the last 50 lines of the file /var/log/redis/redis-server.log
It is very strange, that awk can not read /etc/redis/redis.conf while grep can
YOU expected it, I did not know that and you did not provide that information in your post while it is an important info!
So you did not add the redis config to your /etc/php/8.1/cli/php.ini and /etc/php/8.1/fpm/php.ini:
Thank you. I’d not noticed that, but it makes sense.
Agreed. I tried searching for a little while and could not come up with much.
Whoa, sorry. As I was responding to an existing topic, I was not aware of what “important” info someone else might want.
Yes, you are correct and was a mistake that I made. Which, I ended up discovering later when I set 'memcache.local' => '\\OC\\Memcache\\APCu', and couldn’t get it to work either.