我通过docker容器部署了一个项目,容器启动后一两秒就自动挂掉,docker logs 容器ID 打印日志提示如下,说获得了一个意外的关键字参数username,并从一个空列表中弹出,排查了很久,依然没有头绪,希望获得帮助
conn = self.transport.establish_connection()
File "/usr/local/lib/python3.8/site-packages/kombu/transport/virtual/base.py", line 936, in establish_connection
self._avail_channels.append(self.create_channel(self))
File "/usr/local/lib/python3.8/site-packages/kombu/transport/virtual/base.py", line 918, in create_channel
channel = self.Channel(connection)
File "/usr/local/lib/python3.8/site-packages/kombu/transport/redis.py", line 675, in init
self.client.ping()
File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 1037, in ping
return self.execute_command('PING')
File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 772, in execute_command
connection = pool.get_connection(command_name, **options)
File "/usr/local/lib/python3.8/site-packages/redis/connection.py", line 990, in get_connection
connection = self.make_connection()
File "/usr/local/lib/python3.8/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'
2021-11-15 10:35:43,276 [CRITICAL] /usr/local/lib/python3.8/site-packages/celery/worker/worker.py [line:207] Unrecoverable error: TypeError("init() got an unexpected keyword argument 'username'")
Traceback (most recent call last):
File "/usr/local/lib/python3.8/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/local/lib/python3.8/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/local/lib/python3.8/site-packages/celery/worker/worker.py", line 203, in start
self.blueprint.start(self)
File "/usr/local/lib/python3.8/site-packages/celery/bootsteps.py", line 116, in start
step.start(parent)
File "/usr/local/lib/python3.8/site-packages/celery/bootsteps.py", line 365, in start
return self.obj.start()
File "/usr/local/lib/python3.8/site-packages/celery/worker/consumer/consumer.py", line 311, in start
blueprint.start(self)
File "/usr/local/lib/python3.8/site-packages/celery/bootsteps.py", line 116, in start
step.start(parent)
File "/usr/local/lib/python3.8/site-packages/celery/worker/consumer/connection.py", line 21, in start
c.connection = c.connect()
File "/usr/local/lib/python3.8/site-packages/celery/worker/consumer/consumer.py", line 398, in connect
conn = self.connection_for_read(heartbeat=self.amqheartbeat)
File "/usr/local/lib/python3.8/site-packages/celery/worker/consumer/consumer.py", line 404, in connection_for_read
return self.ensure_connected(
File "/usr/local/lib/python3.8/site-packages/celery/worker/consumer/consumer.py", line 430, in ensure_connected
conn = conn.ensure_connection(
File "/usr/local/lib/python3.8/site-packages/kombu/connection.py", line 382, in ensure_connection
self._ensure_connection(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/kombu/connection.py", line 434, in _ensure_connection
return retry_over_time(
File "/usr/local/lib/python3.8/site-packages/kombu/utils/functional.py", line 312, in retry_over_time
return fun(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/kombu/connection.py", line 878, in _connection_factory
self._connection = self._establish_connection()
File "/usr/local/lib/python3.8/site-packages/kombu/connection.py", line 813, in _establish_connection
conn = self.transport.establish_connection()
File "/usr/local/lib/python3.8/site-packages/kombu/transport/virtual/base.py", line 936, in establish_connection
self._avail_channels.append(self.create_channel(self))
File "/usr/local/lib/python3.8/site-packages/kombu/transport/virtual/base.py", line 918, in create_channel
channel = self.Channel(connection)
File "/usr/local/lib/python3.8/site-packages/kombu/transport/redis.py", line 675, in init
self.client.ping()
File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 1037, in ping
return self.execute_command('PING')
File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 772, in execute_command
connection = pool.get_connection(command_name, **options)
File "/usr/local/lib/python3.8/site-packages/redis/connection.py", line 990, in get_connection
connection = self.make_connection()
File "/usr/local/lib/python3.8/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'