You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may be a duplicate of #2349, in which case I'd like to re-open that issue, but I got a similar error today with redis-py 5.0.1 (worked fine in 5.0.0).
Reading through the stack trace in #2349 again, this may be a separate issue after all? #2349 seemed to happen for async operations. Here it is a synchronous operation...
Again, this works fine using redis-py 5.0.0 (even with 20 or more threads). But with 5.0.1 on Windows I get either an AttributeError:
2023-10-08 13:05:35,683 - ERROR - Thread-2 (_worker) - Failed in round 1
Traceback (most recent call last):
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\connection.py", line 500, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\_parsers\hiredis.py", line 124, in read_response
self.read_from_socket()
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\_parsers\hiredis.py", line 84, in read_from_socket
bufflen = self._sock.recv_into(self._buffer)
OSError: [WinError 10038] An operation was attempted on something that is not a socket
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\PoByBolek\redis-bug\redis_bug.py", line 42, in _worker
redis.setnx(key, 12)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\commands\core.py", line 2374, in setnx
return self.execute_command("SETNX", name, value)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 536, in execute_command
return conn.retry.call_with_retry(
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\retry.py", line 49, in call_with_retry
fail(error)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 540, in <lambda>
lambda error: self._disconnect_raise(conn, error),
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 526, in _disconnect_raise
raise error
File "C:\Users\PoByBolek\redis-bug\redis_bug.py", line 42, in _worker
redis.setnx(key, 12)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\commands\core.py", line 2374, in setnx
return self.execute_command("SETNX", name, value)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 536, in execute_command
return conn.retry.call_with_retry(
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\retry.py", line 46, in call_with_retry
return do()
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 537, in <lambda>
lambda: self._send_command_parse_response(
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 513, in _send_command_parse_response
return self.parse_response(conn, command_name, **options)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 553, in parse_response
response = connection.read_response()
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\connection.py", line 500, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\_parsers\hiredis.py", line 124, in read_response
self.read_from_socket()
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\_parsers\hiredis.py", line 87, in read_from_socket
self._reader.feed(self._buffer, 0, bufflen)
AttributeError: 'NoneType' object has no attribute 'feed'
or a ConnectionError:
2023-10-08 13:13:52,487 - ERROR - Thread-1 (_worker) - Failed in round 2
Traceback (most recent call last):
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\connection.py", line 500, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\_parsers\hiredis.py", line 124, in read_response
self.read_from_socket()
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\_parsers\hiredis.py", line 84, in read_from_socket
bufflen = self._sock.recv_into(self._buffer)
OSError: [WinError 10038] An operation was attempted on something that is not a socket
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\PoByBolek\redis-bug\redis_bug.py", line 42, in _worker
redis.setnx(key, 12)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\commands\core.py", line 2374, in setnx
return self.execute_command("SETNX", name, value)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 536, in execute_command
return conn.retry.call_with_retry(
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\retry.py", line 49, in call_with_retry
fail(error)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 540, in <lambda>
lambda error: self._disconnect_raise(conn, error),
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 526, in _disconnect_raise
raise error
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\retry.py", line 46, in call_with_retry
return do()
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 537, in <lambda>
lambda: self._send_command_parse_response(
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 513, in _send_command_parse_response
return self.parse_response(conn, command_name, **options)
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\client.py", line 553, in parse_response
response = connection.read_response()
File "C:\Users\PoByBolek\redis-bug\venv\lib\site-packages\redis\connection.py", line 508, in read_response
raise ConnectionError(
redis.exceptions.ConnectionError: Error while reading from localhost:6379 : (10038, 'An operation was attempted on something that is not a socket', None, 10038, None)
On Ubuntu 22.04 (WSL) the same code produces a different ConnectionError (again this works fine with redis-py 5.0.0):
2023-10-08 13:19:50,274 - ERROR - Thread-1 (_worker) - Failed in round 1
Traceback (most recent call last):
File "/home/PoByBolek/redis-bug/redis_bug.py", line 42, in _worker
redis.setnx(key, 12)
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/commands/core.py", line 2374, in setnx
return self.execute_command("SETNX", name, value)
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/client.py", line 536, in execute_command
return conn.retry.call_with_retry(
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/retry.py", line 49, in call_with_retry
fail(error)
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/client.py", line 540, in <lambda>
lambda error: self._disconnect_raise(conn, error),
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/client.py", line 526, in _disconnect_raise
raise error
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/retry.py", line 46, in call_with_retry
return do()
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/client.py", line 537, in <lambda>
lambda: self._send_command_parse_response(
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/client.py", line 513, in _send_command_parse_response
return self.parse_response(conn, command_name, **options)
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/client.py", line 553, in parse_response
response = connection.read_response()
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/connection.py", line 500, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/_parsers/hiredis.py", line 124, in read_response
self.read_from_socket()
File "/home/PoByBolek/redis-bug/venv/lib/python3.10/site-packages/redis/_parsers/hiredis.py", line 86, in read_from_socket
raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
redis.exceptions.ConnectionError: Connection closed by server.
The text was updated successfully, but these errors were encountered:
PoByBolek
changed the title
Regression in 5.0.1: AttributeError: 'NoneType' object has no attribute 'feed'
Possible regression in 5.0.1: AttributeError: 'NoneType' object has no attribute 'feed'
Sep 28, 2023
Version
Platform
Description
This may be a duplicate of #2349, in which case I'd like to re-open that issue, but I got a similar error today with redis-py 5.0.1 (worked fine in 5.0.0).
Reading through the stack trace in #2349 again, this may be a separate issue after all? #2349 seemed to happen for async operations. Here it is a synchronous operation...
Again, this works fine using redis-py 5.0.0 (even with 20 or more threads). But with 5.0.1 on Windows I get either an
AttributeError
:or a
ConnectionError
:On Ubuntu 22.04 (WSL) the same code produces a different
ConnectionError
(again this works fine with redis-py 5.0.0):The text was updated successfully, but these errors were encountered: