Skip to content

redis.exceptions.ConnectionError with 4.5.2 #2636

Closed
@eldom9

Description

Version: redis==4.5.2

Platform: Python 3.11 on Alpine Linux with Redis 6.2

Description:
Since todays upgrade from redis 4.5.1 to 4.5.2 the following error log messages from my Django/Celery App which is using Redis as broker appeared:

3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/celery/worker/consumer/consumer.py", line 326, in start
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR blueprint.start(self)
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/celery/bootsteps.py", line 116, in start
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR step.start(parent)
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/celery/worker/consumer/consumer.py", line 618, in start
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR c.loop(*c.loop_args())
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/celery/worker/loops.py", line 81, in asynloop
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR next(loop)
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/kombu/asynchronous/hub.py", line 361, in create_loop
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR cb(*cbargs)
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/kombu/transport/redis.py", line 1128, in on_readable
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR self.cycle.on_readable(fileno)
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/kombu/transport/redis.py", line 398, in on_readable
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR chan.handlers[type]()
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/kombu/transport/redis.py", line 733, in _receive
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ret.append(self._receive_one(c))
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^^^^^^^^^^^^^^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/kombu/transport/redis.py", line 743, in _receive_one
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR response = c.parse_response()
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^^^^^^^^^^^^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/client.py", line 1531, in parse_response
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR response = self._execute(conn, try_read)
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/client.py", line 1507, in _execute
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR return conn.retry.call_with_retry(
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^^^^^^^^^^^^^^^^^^^^^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/retry.py", line 49, in call_with_retry
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR fail(error)
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/client.py", line 1509, in <lambda>
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR lambda error: self._disconnect_raise_connect(conn, error),
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/client.py", line 1496, in _disconnect_raise_connect
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR raise error
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/retry.py", line 46, in call_with_retry
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR return do()
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/client.py", line 1508, in <lambda>
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR lambda: command(*args, **kwargs),
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^^^^^^^^^^^^^^^^^^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/client.py", line 1529, in try_read
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR return conn.read_response()
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^^^^^^^^^^^^^^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 865, in read_response
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR response = self._parser.read_response(disable_decoding=disable_decoding)
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 346, in read_response
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR result = self._read_response(disable_decoding=disable_decoding)
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 356, in _read_response
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR raw = self._buffer.readline()
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR ^^^^^^^^^^^^^^^^^^^^^^^
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 259, in readline
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR self._read_from_socket()
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 212, in _read_from_socket
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
3/21/2023, 8:48:29 PM [APP/PROC/WEB/0] ERR redis.exceptions.ConnectionError: Connection closed by server.

Switching back to redis==4.5.1 resolves the issue.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions