Skip to content

Fix redis NOGROUP errors when running samples#429

Closed
jwilder wants to merge 3 commits intocschleiden:mainfrom
jwilder:jwilder/redis-backend
Closed

Fix redis NOGROUP errors when running samples#429
jwilder wants to merge 3 commits intocschleiden:mainfrom
jwilder:jwilder/redis-backend

Conversation

@jwilder
Copy link
Contributor

@jwilder jwilder commented Sep 16, 2025

Running the samples that use redis where workers are separate generates non-stop errors like the following:

2025/09/15 23:01:02 ERROR error polling task error="dequeueing task: NOGROUP No such key 'task-stream:system:activities' or consumer group 'task-workers' in XREADGROUP with GROUP option"

The original error occurred because:

  • The worker tries to recover abandoned tasks during startup using XAUTOCLAIM
  • This requires existing consumer groups for the Redis streams
  • Previously, consumer groups were only created when PrepareWorkflowQueues/PrepareActivityQueues were explicitly called
  • The recovery operations happened before queue preparation, causing NOGROUP errors

The fix ensures that consumer groups for the essential queues (default and system) are created automatically during Redis backend initialization, eliminating the race condition.

Running the samples that use redis where workers are separate generates non-stop errors
like the following:

2025/09/15 23:01:02 ERROR error polling task error="dequeueing task: NOGROUP No such key 'task-stream:system:activities' or consumer group 'task-workers' in XREADGROUP with GROUP option"

The original error occurred because:

* The worker tries to recover abandoned tasks during startup using XAUTOCLAIM
* This requires existing consumer groups for the Redis streams
* Previously, consumer groups were only created when PrepareWorkflowQueues/PrepareActivityQueues were explicitly called
* The recovery operations happened before queue preparation, causing NOGROUP errors

The fix ensures that consumer groups for the essential queues (default and _system_) are created automatically during Redis backend initialization, eliminating the race condition.
@cschleiden cschleiden force-pushed the jwilder/redis-backend branch from c53a377 to 521f2ce Compare September 20, 2025 05:00
@cschleiden
Copy link
Owner

@jwilder Thanks for the report and PR! I took another look at this, and went with this fix instead: #435

The issue was that the Redis DB was flushed when starting the samples, which led to issues with those missing groups for queues.

@cschleiden cschleiden closed this Sep 21, 2025
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

Successfully merging this pull request may close these issues.

2 participants