Skip to content

ERROR: Error fetching job: READONLY You can't write against a read only replica. #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Annastacia-dev opened this issue Mar 17, 2025 · 0 comments

Comments

@Annastacia-dev
Copy link

Annastacia-dev commented Mar 17, 2025

I'm using sidekiq in my rails app for background processing that depends on a redis container that I have in my compose.yml

 redis:
    image: redis:latest
    container_name: redis_server
    ports:
      - "6379:6379"
    command: redis-server --appendonly yes
    sysctls:
     - net.core.somaxconn=1024
    volumes:
      - redis_data:/data

It works most of the time but sometimes I get this error

 ERROR: Error fetching job: READONLY You can't write against a read only replica.
 2025-03-16T06:30:27.285Z pid=1 tid=j7p WARN: RedisClient::ReadOnlyError: READONLY You can't write against a read only replica. (redis://redis:6379)
 2025-03-16T06:30:27.286Z pid=1 tid=j7p WARN:
 2025-03-16T06:30:28.756Z pid=1 tid=10y1 WARN: Unable to flush stats: READONLY You can't write against a read only replica.
 2025-03-16T06:30:28.771Z pid=1 tid=10y1 ERROR: heartbeat: READONLY You can't write against a read only replica.
 2025-03-16T06:30:35.400Z pid=1 tid=j7p INFO: Redis is online, 8.11720569897443 sec downtime

Which removes all my cron jobs added to the queue and I have to restart my containers.

I have never used redis inside docker before and I haven't faced this issue when using redis anywhere else before.

Any idea what the cause is and how I could fix it would be highly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant