Redis Streams "BUSYGROUP Consumer Group name already exists" in CI
XGROUP CREATE failed because the consumer group already exists on the stream. This is not a real failure: it usually means the create step ran again on a reused stream. The fix is to make group creation idempotent.
What this error means
XGROUP CREATE fails with "BUSYGROUP Consumer Group name already exists", failing a setup step or app startup that does not tolerate it.
BUSYGROUP Consumer Group name already existsCommon causes
The group was already created on this stream
A previous setup run or a parallel worker already created the group, so a second XGROUP CREATE is rejected.
A reused Redis kept the group from an earlier run
A persisted Redis retained the consumer group across CI runs, so the fresh create collides.
How to fix it
Tolerate BUSYGROUP as success
Catch the BUSYGROUP error and continue; the group already existing is the desired state.
redis-cli XGROUP CREATE events workers $ MKSTREAM || trueMake startup group creation idempotent
Wrap XGROUP CREATE so a BUSYGROUP reply is ignored at app startup.
- Call XGROUP CREATE ... MKSTREAM at startup.
- Catch the BUSYGROUP reply and treat it as already-created.
- Proceed to consume regardless of which run created the group.
How to prevent it
- Make consumer-group creation idempotent on BUSYGROUP.
- Prefer an ephemeral Redis per CI run.
- Create groups once in setup, then let consumers assume they exist.