RedisClient::ReadOnlyError (READONLY You can't write against a read only replica #2055
Replies: 4 comments
-
Could be something in Maybe trying to use REPLICAOF command and then trying to write to a replica (not allowed - replicas are read only) instead of writing to master? I don't know if your using it on Maybe or what happened in Redis to have a replicate created. I don't know the expected behaviour of jobs and workers and how are handling it on Readis, but I'm reading it's possible to set a redis configuration to force to avoid creating replicas and use always master, and in this case the REPLICAOF command won't do anyting and writing problem won't occur. |
Beta Was this translation helpful? Give feedback.
-
@javiermartingonzalez this does not appear to be related to Maybe. We're not seeing this error in production, which tells me that this is some sort of resource contention issue on the host machine (out of memory?? causing Redis to attempt some sort of failover behavior). Looks like this has recently come up for others as well: redis/docker-library-redis#434 I'm going to move this over to our Docker discussions as I don't believe there is any direct action we can take on Maybe's end to fix this (other than potentially updating our "example" compose file with a different Redis image) |
Beta Was this translation helpful? Give feedback.
-
Thank you! @zachgoll I will check the reason of creating replicas if the Maybe behaviour is not using REPLICAOF command. I will also try to force Redis to avoid creating replicas and using always master node. But in another hand, a troubleshoot / maintenance to clean pending stucked jobs will be useful without sh to the machine. Because if old jobs are not cancelled, the information is not accurate and now there is no easy way to retry without removing manually from database |
Beta Was this translation helpful? Give feedback.
-
https://bobcares.com/blog/readonly-you-cant-write-against-a-read-only-replica/ Some users suggested to add
Trying adding (under volumes and the same level):
Another solution is to use redis:alpine instead of redis:latest when using it with Docker. Will try both solutions and give feedback if they are working or not |
Beta Was this translation helpful? Give feedback.
-
Before you start (required)
General checklist
How are you using Maybe?
Self hoster checklist
Paying, hosted users should delete this entire section.
If you are a self-hosted user, please complete all of the information below. Issues with incomplete information will be marked as
Needs Info
to help our small team prioritize bug fixes.Bug description
Sometimes, the sync process is not working. I'm getting "error application" page and after checking the logs the error is:
E, [2025-04-04T07:55:20.983594 #1] ERROR -- : [ActiveJob] Failed enqueuing SyncJob to Sidekiq(high_priority): RedisClient::ReadOnlyError (READONLY You can't write against a read only replica. (redis://redis:6379/1))
So, sync is not finished and I have to remove pending status jobs from database, restart the containers and try again.
Redis service is up and giving the error:
Trying to access to Redis contaner and set a test value, I'm getting same error:
Restarting the containers and trying again, is working again. So I don't know if it's a lock due something Maybe is sending to Redis or a Redis problem keeping the services on. Also, the need to delete manually the jobs from database is not a good solution. Can you check? Could be possible a button in the interface to delete the pending jobs clicking on it without ssh to the machine?
To Reproduce
Trying to sync different kinds of accounts manually or automatically by the cron
Expected behavior
To finish the job in the background
Beta Was this translation helpful? Give feedback.
All reactions