Skip to main content

Fix Redis/NC WRONGPASS Errors

For reasons unknown, sometimes my NC installs will get flooded with log entries because the Redis password isn't working. Here are the steps I took to fix that:

Fix Redis WRONGPASS/NOAUTH

Verify Redis auth on the the Redis LXC
redis-cli -h <REDIS_IP> -p 6379
AUTH <REDIS_PASSWORD>
PING
CONFIG GET requirepass
ACL LIST
  • PONG confirms connectivity + auth
  • CONFIG GET requirepass should show the exact password you expect
  • ACL LIST should have user default on ... +@all (which is fine for my setup)

Point NC at Redis on the NC LXC

Make sure these things are in NC's config (var/www/nextcloud/config/)

'memcache.local'   => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' => [
  'host'         => '<REDIS_IP>',
  'port'         => 6379,
  'password'     => '<REDIS_PASSWORD>',
  'dbindex'      => 0,
  'timeout'      => 1.5,
  'read_timeout' => 1.5,
],

Make Sure PHP has Redis ext Enabled

grep -Rni redis.so /etc/php/*/fpm /etc/php/*/cli

Bounce PHP-PFM + Web

systemctl restart php8.3-fpm
systemctl reload nginx 2>/dev/null || systemctl reload apache2

Sanity Check via OCC

sudo -u www-data php /var/www/nextcloud/occ config:system:get redis

Truncate the NC Logs and Flush Redis DB 

Change the DB number to your actual!

truncate -s 0 /opt/ncdata/data/nextcloud.log
redis-cli -h <REDIS_IP> -a '<REDIS_PASSWORD>' -n 0 FLUSHDB