Channels: Connection failed (error 111)

Created on 17 Jul 2016  路  5Comments  路  Source: django/channels

Hello,

I am trying to follow the tutorial on read the docs, I am at this paragraph : https://channels.readthedocs.io/en/latest/getting-started.html#running-with-channels. I installed asgi_redis and I set up my channel layer.

But when I run this command manage.py runworker (before I run manage.py runserver --noworker) , I have this error :

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/home/project/channels/management/commands/runworker.py", line 60, in handle
    exclude_channels=options.get("exclude_channels", None),
  File "/home/project/channels/worker.py", line 79, in run
    channel, content = self.channel_layer.receive_many(channels, block=True)
  File "/usr/local/lib/python2.7/dist-packages/asgi_redis/core.py", line 129, in receive_many
    result = connection.blpop(list_names, timeout=self.blpop_timeout)
  File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 1163, in blpop
    return self.execute_command('BLPOP', *keys)
  File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 578, in execute_command
    connection.send_command(*args)
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 563, in send_command
    self.send_packed_command(self.pack_command(*args))
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 538, in send_packed_command
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 442, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.

I don't understand because I good followed this tutorial..

Most helpful comment

I suggest to start a redis server on your system: http://redis.io.

redis-server

All 5 comments

I suggest to start a redis server on your system: http://redis.io.

redis-server

Yes, it's works now.. Thank you !

Should this be mentioned in the tutorial? (documentation bug)

I've added a short sentence about installing it into the docs to make it more obvious if you don't realise.

facing the same issue while deploying a application that use django channel and redis server to ibm cloud. what to do

Was this page helpful?
0 / 5 - 0 ratings