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:
3. Add the www-data user to the Redis group:
usermod -a -G redis www-data
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!
- Memory caching - docs.nextcloud.com