question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redis regression with kombu 5.2.0

See original GitHub issue

Upon starting up a Celery worker to verify the new release:

[2021-11-05 10:41:38,224: CRITICAL/MainProcess] Unrecoverable error: TypeError("__init__() got an unexpected keyword argument 'username'")
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/kombu/transport/virtual/base.py", line 916, in create_channel
    return self._avail_channels.pop()
IndexError: pop from empty list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/redis/connection.py", line 988, in get_connection
    connection = self._available_connections.pop()
IndexError: pop from empty list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/celery/worker/worker.py", line 203, in start
    self.blueprint.start(self)
  File "/usr/lib/python3.9/site-packages/celery/bootsteps.py", line 116, in start
    step.start(parent)
  File "/usr/lib/python3.9/site-packages/celery/bootsteps.py", line 365, in start
    return self.obj.start()
  File "/usr/lib/python3.9/site-packages/celery/worker/consumer/consumer.py", line 326, in start
    blueprint.start(self)
  File "/usr/lib/python3.9/site-packages/celery/bootsteps.py", line 116, in start
    step.start(parent)
  File "/usr/lib/python3.9/site-packages/celery/worker/consumer/connection.py", line 21, in start
    c.connection = c.connect()
  File "/usr/lib/python3.9/site-packages/celery/worker/consumer/consumer.py", line 422, in connect
    conn = self.connection_for_read(heartbeat=self.amqheartbeat)
  File "/usr/lib/python3.9/site-packages/celery/worker/consumer/consumer.py", line 428, in connection_for_read
    return self.ensure_connected(
  File "/usr/lib/python3.9/site-packages/celery/worker/consumer/consumer.py", line 454, in ensure_connected
    conn = conn.ensure_connection(
  File "/usr/lib/python3.9/site-packages/kombu/connection.py", line 382, in ensure_connection
    self._ensure_connection(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/kombu/connection.py", line 434, in _ensure_connection
    return retry_over_time(
  File "/usr/lib/python3.9/site-packages/kombu/utils/functional.py", line 312, in retry_over_time
    return fun(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/kombu/connection.py", line 878, in _connection_factory
    self._connection = self._establish_connection()
  File "/usr/lib/python3.9/site-packages/kombu/connection.py", line 813, in _establish_connection
    conn = self.transport.establish_connection()
  File "/usr/lib/python3.9/site-packages/kombu/transport/virtual/base.py", line 936, in establish_connection
    self._avail_channels.append(self.create_channel(self))
  File "/usr/lib/python3.9/site-packages/kombu/transport/virtual/base.py", line 918, in create_channel
    channel = self.Channel(connection)
  File "/usr/lib/python3.9/site-packages/kombu/transport/redis.py", line 675, in __init__
    self.client.ping()
  File "/usr/lib/python3.9/site-packages/redis/client.py", line 1037, in ping
    return self.execute_command('PING')
  File "/usr/lib/python3.9/site-packages/redis/client.py", line 772, in execute_command
    connection = pool.get_connection(command_name, **options)
  File "/usr/lib/python3.9/site-packages/redis/connection.py", line 990, in get_connection
    connection = self.make_connection()
  File "/usr/lib/python3.9/site-packages/redis/connection.py", line 1025, in make_connection
    return self.connection_class(**self.connection_kwargs)
TypeError: __init__() got an unexpected keyword argument 'username'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kaxilcommented, Dec 8, 2021

Update: the user had 3.5.3 installed but then copied redis’s 3.2.1 to site-packages which was causing the issue.

This is fixed now, thanks

2reactions
ddevaultcommented, Nov 6, 2021

Confirmed fix on newer redis-py version. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change history — Kombu 5.2.4 documentation - Celery
Fix regression that occurred in 4.3.0 when parsing Redis Sentinel master URI containing password. Contributed by Peter Lithammer.
Read more >
Kombu Documentation - Read the Docs
Kombu is a messaging library for Python. The aim of Kombu is to make messaging in Python as easy as possible by providing...
Read more >
Celery - Open Collective
Celery 5.2.1 is released with some bug fixes and minor enhancement. This also bump kombu to 5.2.2 which limit redis-py below 4.0.0. you...
Read more >
The NetBSD package collection - pkgsrc.se
fix: reduce latency of AsyncResult.get under gevent (#7052) - Limit redis version: <4.0.0. - Bump min kombu version to 5.2.2. - Change pytz>dev...
Read more >
kombu-redis-priority - PyPI
kombu -redis-priority 0.3.0. pip install kombu-redis-priority. Copy PIP instructions. Latest version. Released: Jul 2, 2018. Celery backend using redis ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found