The Fix
pip install redis==7.1.0
Based on closed redis/redis-py issue #2629 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
+import os
+
+
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/ewoksutils/logging_utils/connection.py", line 73, in emit
self._send_serialized_record(s)
File "/builds/workflow/ewoks/ewoksjob/src/ewoksjob/events/handlers/redis.py", line 49, in _send_serialized_record
n = self._connection.incrby("ewoks_events_count")
File "/usr/local/lib/python3.7/site-packages/redis/commands/core.py", line 1914, in incrby
return self.execute_command("INCRBY", name, amount)
File "/usr/local/lib/python3.7/site-packages/redis/client.py", line 1255, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 1441, in get_connection
connection.connect()
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 699, in connect
lambda: self._connect(), lambda error: self.disconnect(error)
File "/usr/local/lib/python3.7/site-packages/redis/retry.py", line 46, in call_with_retry
return do()
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 699, in <lambda>
lambda: self._connect(), lambda error: self.disconnect(error)
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 1171, in _connect
sock.settimeout(self.socket_timeout)
AttributeError: 'UnixDomainSocketConnection' object has no attribute 'socket_timeout'
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install redis==7.1.0\nWhen NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.\n\n
Why This Fix Works in Production
- Trigger: self._send_serialized_record(s)
- Mechanism: 'UnixDomainSocketConnection' was missing the 'socket_timeout' after the refactoring
- Why the fix works: 'UnixDomainSocketConnection' was missing the 'socket_timeout' after the refactoring. (first fixed release: 7.1.0).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Shows up under Python 3.7 in real deployments (not just unit tests).
- 'UnixDomainSocketConnection' was missing the 'socket_timeout' after the refactoring
- Surfaces as: Traceback (most recent call last):
Proof / Evidence
- GitHub issue: #2629
- Fix PR: https://github.com/redis/redis-py/pull/2631
- First fixed release: 7.1.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-07
- Confidence: 0.75
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.26
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“It seems that in the mean time, 4.5.3 and 5.0.0b1 have been released”
“In that case you can nuke 4.5.0 as well.”
“FYI I added connection tests for TCP, TCP-SSL and UDS in another PR: https://github.com/redis/redis-py/pull/2631. So at least the issues with 4.5.0 and 4.5.2 would be…”
“Thanks @woutdenolf ... I won't lie, as a Star Wars fan, I loved everything ewok releated here :D”
Failure Signature (Search String)
- self._send_serialized_record(s)
Error Message
Stack trace
Error Message
-------------
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/ewoksutils/logging_utils/connection.py", line 73, in emit
self._send_serialized_record(s)
File "/builds/workflow/ewoks/ewoksjob/src/ewoksjob/events/handlers/redis.py", line 49, in _send_serialized_record
n = self._connection.incrby("ewoks_events_count")
File "/usr/local/lib/python3.7/site-packages/redis/commands/core.py", line 1914, in incrby
return self.execute_command("INCRBY", name, amount)
File "/usr/local/lib/python3.7/site-packages/redis/client.py", line 1255, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 1441, in get_connection
connection.connect()
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 699, in connect
lambda: self._connect(), lambda error: self.disconnect(error)
File "/usr/local/lib/python3.7/site-packages/redis/retry.py", line 46, in call_with_retry
return do()
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 699, in <lambda>
lambda: self._connect(), lambda error: self.disconnect(error)
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 1171, in _connect
sock.settimeout(self.socket_timeout)
AttributeError: 'UnixDomainSocketConnection' object has no
... (truncated) ...
Stack trace
Error Message
-------------
File ".venv/lib/python3.10/site-packages/redis/client.py", line 1255, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File ".venv/lib/python3.10/site-packages/redis/connection.py", line 1436, in get_connection
connection = self.make_connection()
File ".venv/lib/python3.10/site-packages/redis/connection.py", line 1476, in make_connection
return self.connection_class(**self.connection_kwargs)
File ".venv/lib/python3.10/site-packages/redis/connection.py", line 1160, in __init__
super().__init__(**kwargs)
TypeError: AbstractConnection.__init__() got an unexpected keyword argument 'socket_timeout'
Minimal Reproduction
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/ewoksutils/logging_utils/connection.py", line 73, in emit
self._send_serialized_record(s)
File "/builds/workflow/ewoks/ewoksjob/src/ewoksjob/events/handlers/redis.py", line 49, in _send_serialized_record
n = self._connection.incrby("ewoks_events_count")
File "/usr/local/lib/python3.7/site-packages/redis/commands/core.py", line 1914, in incrby
return self.execute_command("INCRBY", name, amount)
File "/usr/local/lib/python3.7/site-packages/redis/client.py", line 1255, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 1441, in get_connection
connection.connect()
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 699, in connect
lambda: self._connect(), lambda error: self.disconnect(error)
File "/usr/local/lib/python3.7/site-packages/redis/retry.py", line 46, in call_with_retry
return do()
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 699, in <lambda>
lambda: self._connect(), lambda error: self.disconnect(error)
File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 1171, in _connect
sock.settimeout(self.socket_timeout)
AttributeError: 'UnixDomainSocketConnection' object has no attribute 'socket_timeout'
Environment
- Python: 3.7
What Broke
Critical bug causing socket connections to fail, impacting application functionality.
Why It Broke
'UnixDomainSocketConnection' was missing the 'socket_timeout' after the refactoring
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install redis==7.1.0
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/redis/redis-py/pull/2631
First fixed release: 7.1.0
Last verified: 2026-02-07. Validate in your environment.
When NOT to Use This Fix
- Do not use if it changes public behavior or if the failure cannot be reproduced.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a TLS smoke test that performs a real handshake in CI (include CA bundle validation and hostname checks).
- Alert on handshake failures by error string and endpoint to catch cert/CA changes quickly.
- Make timeouts explicit and test them (unit + integration) to avoid silent behavior changes.
- Instrument retries (attempt count + reason) and alert on spikes to catch dependency slowdowns.
Version Compatibility Table
| Version | Status |
|---|---|
| 7.1.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.