Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Redis Error unknown command 'BZPOPMIN'

I've installed Redis 3.0.54. Django is updated. I'm learning channels from the tutorial page.

This is my terminal window for redis-cli and redis server Image of Terminal

System check identified no issues (0 silenced).
August 06, 2020 - 16:04:58
Django version 3.1, using settings 'mysite.settings'
Starting ASGI/Channels version 2.4.0 development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
HTTP GET /chat/lobby/ 200 [0.02, 127.0.0.1:60841]
WebSocket HANDSHAKING /ws/chat/lobby/ [127.0.0.1:60843]
WebSocket CONNECT /ws/chat/lobby/ [127.0.0.1:60843]
Exception inside application: ERR unknown command 'BZPOPMIN'
Traceback (most recent call last):
  File "C:\Users\\Envs\py2\lib\site-packages\channels\sessions.py", line 183, in __call__
    return await self.inner(receive, self.send)
  File "C:\Users\\Envs\py2\lib\site-packages\channels\middleware.py", line 41, in coroutine_call
    await inner_instance(receive, send)
  File "C:\Users\\Envs\py2\lib\site-packages\channels\consumer.py", line 59, in __call__
    [receive, self.channel_receive], self.dispatch
  File "C:\Users\\Envs\py2\lib\site-packages\channels\utils.py", line 58, in await_many_dispatch
    await task
  File "C:\Users\\Envs\py2\lib\site-packages\channels\utils.py", line 50, in await_many_dispatch
    result = task.result()
  File "C:\Users\\Envs\py2\lib\site-packages\channels_redis\core.py", line 453, in receive
    real_channel
  File "C:\Users\\Envs\py2\lib\site-packages\channels_redis\core.py", line 508, in receive_single
    index, channel_key, timeout=self.brpop_timeout
  File "C:\Users\\Envs\py2\lib\site-packages\channels_redis\core.py", line 345, in _brpop_with_clean
    result = await connection.bzpopmin(channel, timeout=timeout)
aioredis.errors.ReplyError: ERR unknown command 'BZPOPMIN'
WebSocket DISCONNECT /ws/chat/lobby/ [127.0.0.1:60843]
like image 876
Quinn Sambrano Avatar asked Mar 12 '26 16:03

Quinn Sambrano


2 Answers

BZPOPMIN and BZPOPMAX(also non-blocking versions ZPOPMIN and ZPOPMAX) are "Available since 5.0.0". You need to upgrade your redis to at least version 5 to use them, since you use version 3.0.54.

You may check download page for available versions and instructions to download them.

like image 198
Ersoy Avatar answered Mar 14 '26 05:03

Ersoy


download the latest version of Redis from here and try it will work

https://github.com/tporadowski/redis/releases

like image 21
Maninder Singh Avatar answered Mar 14 '26 05:03

Maninder Singh