I'm having this issue with redis, i have a node app that listens on a socket, it runs constantly with forever and uses redis to store data. After a couple of hours the node app crashes and it logs:
READONLY You can't write against a read only replica
The thing is, i don't know why it randomly becomes read only, i only have a single instance of redis running inside a docker container with appendonlydir set to store all the data in a file. The path is fully accessible by the redis container and i can see the appendonlydir file on the host and inside the container.
There isn't much more i can give, the error is above with no indication of why it's randomly happening after the writing is working perfectly fine for a few hours.
If it helps my dockerfile:
FROM redis:7.0.0
RUN usermod --uid 1001 redis
RUN groupmod --gid 1001 redis
EXPOSE 6379
COPY ./docker/chat-redis/redis.conf /usr/local/etc/redis/redis.conf
CMD ["redis-server", "--include /usr/local/etc/redis/redis.conf"]
The folder on the host is owned by 1001:1001 and as i say can write to it perfectly fine when i first start up the redis container.
Please let me know if you need to see any of the redis.conf file, i haven't much in there except the default for version 7 and appendonlydir turned on.
Thee permissions on the directory are also allowing writing of the owner which is 1001
drwx------ 2 1001 1001 4096 Jun 6 13:39 appendonlydir