Closed dwjorgeb closed 1 year ago
Oh, that's sad. So you use https://github.com/gaiacoop/django-huey ? Can you provide a Trackback here? So we just catch the error. Because i didn't think it's a good idea to support "django-huey", yet.
I'm using django_huey in order to be able to run multiple queues.
The error is coming from that template tag that I posted above, as it is trying to fetch Huey's queue directly, which is not configured, and hence connecting to a non-existant redis.
Here is the full stack trace
OSError: [Errno 99] Cannot assign requested address
File "redis/connection.py", line 707, in connect
sock = self.retry.call_with_retry(
File "redis/retry.py", line 46, in call_with_retry
return do()
File "redis/connection.py", line 708, in <lambda>
lambda: self._connect(), lambda error: self.disconnect(error)
File "redis/connection.py", line 1006, in _connect
raise err
File "redis/connection.py", line 994, in _connect
sock.connect(socket_address)
ConnectionError: Error 99 connecting to localhost:6379. Cannot assign requested address.
File "django/core/handlers/exception.py", line 38, in inner
response = await get_response(request)
File "django/core/handlers/base.py", line 263, in _get_response_async
response = await sync_to_async(response.render, thread_sensitive=True)()
File "django/template/response.py", line 105, in render
self.content = self.rendered_content
File "django/template/response.py", line 83, in rendered_content
return template.render(context, self._request)
File "django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "django/template/base.py", line 170, in render
return self._render(context)
File "django/template/base.py", line 162, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 905, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "django/template/base.py", line 162, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 905, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "django/template/base.py", line 162, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 905, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "django/template/base.py", line 162, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 905, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 62, in render
result = block.nodelist.render(context)
File "django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 905, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 62, in render
result = block.nodelist.render(context)
File "django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 905, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 62, in render
result = block.nodelist.render(context)
File "django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "django/template/base.py", line 905, in render_annotated
return self.render(context)
File "django/template/library.py", line 192, in render
output = self.func(*resolved_args, **resolved_kwargs)
File "huey_monitor/templatetags/huey_monitor.py", line 12, in huey_counts_info
huey_pending_count=HUEY.pending_count(),
File "huey/api.py", line 594, in pending_count
return self.storage.queue_size()
File "huey/storage.py", line 432, in queue_size
return self.conn.llen(self.queue_key)
File "redis/commands/core.py", line 2694, in llen
return self.execute_command("LLEN", name)
File "redis/client.py", line 1266, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File "redis/connection.py", line 1461, in get_connection
connection.connect()
File "redis/connection.py", line 713, in connect
raise ConnectionError(self._error_message(e))
Thanks. Think i will catch OSError
, so it's no problem if redis
not used ;)
@dwjorgeb it's fixed and released as v0.7.1
The version 0.7.0 gives a ConnectionError when using this library with
django_huey
's multi-queues.Error seems to be here:
It tries to connect to a non-existing queue