ConnectionResetError: [Errno 104] Connection reset by peer
See original GitHub issueHi, everybody!
I use torando+aioredis, and recently i met this issue, below is traceback
my environ: aioredis==1.2.0 tornado==5.1.1
I use this method aioredis.create_redis_pool(**args)
to create pool
can anybody show me help? thx a lot.
`Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/views/notice.py", line 341, in get
items, page_size, total_page, total_size = await Notice.cache_or_api_list(notice_id_list, page_count, page_size)
File "models/notice.py", line 136, in cache_or_api_list
items = await cls.query_list(page_list)
File "models/notice.py", line 92, in query_list
items = await asyncio.gather(*[Notice.cache_or_api(notice_id) for notice_id in notice_id_list])
File "models/notice.py", line 37, in cache_or_api
info = await redis.execute('get', redis_key)
File "models/notice.py", line 37, in cache_or_api
info = await redis.execute('get', redis_key)
File "models/notice.py", line 37, in cache_or_api
info = await redis.execute('get', redis_key)
[Previous line repeated 11 more times]
File "/usr/local/lib/python3.6/site-packages/aioredis/connection.py", line 183, in _read_data
obj = await self._reader.readobj()
File "/usr/local/lib/python3.6/site-packages/aioredis/stream.py", line 94, in readobj
await self._wait_for_data('readobj')
File "/usr/local/lib/python3.6/asyncio/streams.py", line 464, in _wait_for_data
yield from self._waiter
File "/usr/local/lib/python3.6/asyncio/selector_events.py", line 723, in _read_ready
data = self._sock.recv(self.max_size)
ConnectionResetError: [Errno 104] Connection reset by peer`
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:58 (2 by maintainers)
Top Results From Across the Web
Python handling socket.error: [Errno 104] Connection reset by ...
"Connection reset by peer" is the TCP/IP equivalent of slamming the phone back on the hook. It's more polite than merely not replying, ......
Read more >How do I fix connectionreseterror: [errno 104] connection reset ...
ConnectionResetError : [Errno 104] Connection reset by peer (From server) traceback: Traceback (most recent call last): File "server.py", ...
Read more >[Errno 104] Connection reset by peer - PYTHON - YouTube
PYTHON : Python handling socket.error: [ Errno 104 ] Connection reset by peer [ Gift : Animated Search Engine ...
Read more >[errno 104] connection reset by peer - You.com
When I tried to connect to the server (which was hosted on my system) by another system connected to same LAN network, this...
Read more >What does the '(104) Connection reset by peer' error ... - Quora
This means that a TCP RST was received and the connection is now closed. · As a user you should try to open...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Were you able to reproduce the error? If not, I think we should focus on that first. 😃 You need to find a way to reset or abort a TCP connection in macOS, or otherwise, test this into a Linux box, where you can use
ss
, which aborts the connection. AFAIK, there’s no equivalent in macOS. But there’s thetcpkill
utility, fromdsniff
, which seems to work on macOS too (at least this fork).I just tried
tcpkill
myself on Linux and works nicely by resetting the connection (exactly the same issue I’ve found in production). There are two things you need to do for this to work. First, launchtcpkill
:Here
tcpkill
keeps listening the loopback interface and will reset any TCP connection to port 6379 (if your Redis host is not local, then just change the interface accordingly). And secondly, you need to force an IPv4 connection (becausetcpkill
doesn’t understand IPv6). Again for localhost, you just need to specifyredis = Redis(host="127.0.0.1")
in my test case above.Now that Aioredis is in redis-py 4.2.0rc1, is the expectation that this issue will go away once we migrate to
redis
? Any idea when a non-rc version will be released? Thanks for all your hard work!