[GH-ISSUE #959] [BUG] asynq can not follow the right redis master when using sentinel mode. #2488

Open
opened 2026-03-15 20:39:09 +03:00 by kerem · 2 comments
Owner

Originally created by @hoorayman on GitHub (Nov 7, 2024).
Original GitHub issue: https://github.com/hibiken/asynq/issues/959

Originally assigned to: @hibiken, @kamikazechaser on GitHub.

Describe the bug
asynq can not follow the right redis master.

Environment:

  • OS: [Linux]
  • asynq package version [e.g. v0.25.0]
  • Redis/Valkey version

To Reproduce
use helm to install a redis cluster, with sentinel be set to true.
configure the asynq using sentinel:
image

Expected behavior
asynq can follow the right master and running normally.

Screenshots
go-redis can find the right master and change:
image
But asynq report error:
asynq: pid=1 2024/11/07 08:23:58.539202 ERROR: Dequeue error: UNKNOWN: redis eval error: READONLY You can't write against a read only replica. script: a8153319360adc71cdc370107f8ab9786f204765, on @user_script:3.
asynq: pid=1 2024/11/07 08:23:58.557608 ERROR: Failed to write server state data: UNKNOWN: redis command error: SADD failed: READONLY You can't write against a read only replica.

Originally created by @hoorayman on GitHub (Nov 7, 2024). Original GitHub issue: https://github.com/hibiken/asynq/issues/959 Originally assigned to: @hibiken, @kamikazechaser on GitHub. **Describe the bug** asynq can not follow the right redis master. **Environment:** - OS: [Linux] - `asynq` package version [e.g. v0.25.0] - Redis/Valkey version **To Reproduce** use helm to install a redis cluster, with sentinel be set to true. configure the asynq using sentinel: ![image](https://github.com/user-attachments/assets/9e8629c4-b236-4420-929e-74e88e119f15) **Expected behavior** asynq can follow the right master and running normally. **Screenshots** go-redis can find the right master and change: ![image](https://github.com/user-attachments/assets/ddcbf8c7-ba24-438c-a425-2c10d002ccbc) But asynq report error: asynq: pid=1 2024/11/07 08:23:58.539202 ERROR: Dequeue error: UNKNOWN: redis eval error: READONLY You can't write against a read only replica. script: a8153319360adc71cdc370107f8ab9786f204765, on @user_script:3. asynq: pid=1 2024/11/07 08:23:58.557608 ERROR: Failed to write server state data: UNKNOWN: redis command error: SADD failed: READONLY You can't write against a read only replica.
Author
Owner

@kamikazechaser commented on GitHub (Nov 13, 2024):

This is most likely an issue with misconfiguration when using go-redis with Redis sentinel (Also, because you are running this in k8s, you will most likely have only 1 service that points to the redis sentinel endpoint). Could you debug a simple go-redis application first https://redis.uptrace.dev/guide/go-redis-sentinel.html#redis-server-client?

<!-- gh-comment-id:2473450880 --> @kamikazechaser commented on GitHub (Nov 13, 2024): This is most likely an issue with misconfiguration when using go-redis with Redis sentinel (Also, because you are running this in k8s, you will most likely have only 1 service that points to the redis sentinel endpoint). Could you debug a simple go-redis application first https://redis.uptrace.dev/guide/go-redis-sentinel.html#redis-server-client?
Author
Owner

@hoorayman commented on GitHub (Apr 12, 2025):

This is most likely an issue with misconfiguration when using go-redis with Redis sentinel (Also, because you are running this in k8s, you will most likely have only 1 service that points to the redis sentinel endpoint). Could you debug a simple go-redis application first https://redis.uptrace.dev/guide/go-redis-sentinel.html#redis-server-client?

It might be because I only configured one service name. I'll configure three headless services and observe again.

<!-- gh-comment-id:2798708446 --> @hoorayman commented on GitHub (Apr 12, 2025): > This is most likely an issue with misconfiguration when using go-redis with Redis sentinel (Also, because you are running this in k8s, you will most likely have only 1 service that points to the redis sentinel endpoint). Could you debug a simple go-redis application first https://redis.uptrace.dev/guide/go-redis-sentinel.html#redis-server-client? It might be because I only configured one service name. I'll configure three headless services and observe again.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#2488
No description provided.