Nextcloud: Redis server went away
This can happen when the Redis environment is configured incorrectly, and/or when the redis-server.sock file has the wrong permissions.
By. Jacob
Created: 2023-09-25 22:22
RedisException: Redis server went away
On my Nextcloud server I was getting an error like this. It can happen after updating server software or changing servers. A common cause for it is that you forgot to install Redis, or you did not configure Redis properly.
Verify that your Redis redis-server.sock file has the right permissions, and that your www-data user is added to the redis group. E.g:
1. Setup Redis to use redis-server.sock with the right permissions. Edit your /etc/redis.conf file like this:
unixsocket /var/run/redis/redis-server.sock
unixsocketperm 775
2. (If needed), verify your Nextcloud configuration file is pointing at the Redis .sock file; Debian/Ubuntu might keep create the file in:
/var/run/redis/redis-server.sock
3. Add the www-data user to the Redis group:
usermod -a -G redis www-data
Syntax:
usermod -a -G groupname username
-a or --append — add the user to the group'(s).
-G or --groups — the group'(s) to add the user to.
4. Restart your server to refresh the group permissions:
sudo reboot now
Also, make sure the php-redis module is installed:
sudo apt install php8.2-redis
Surprisingly, some of the only documentation I found online about this issue were incorrectly telling people to add the redis user to the www-data user group. Don't do that. It's obviously the other way around!
Links
- Memory caching - docs.nextcloud.com
Tell us what you think: