question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

aiohttp.client_exceptions.ClientOSError: [WinError 10054] An existing connection was forcibly closed by the remote host

See original GitHub issue

Summary

Sometimes I get the aiohttp.client_exceptions.ClientOSError: [WinError 10054] An existing connection was forcibly closed by the remote host error.

Reproduction Steps

There are no reproduction steps since this error is random. My code worked OK before, but now, without any changes in code, it throws this error. But I think it might be because of calling the exact same commands for bot.

Expected Results

I expected my code to work as before.

Actual Results

As I have already said, the were no changes in code since the moment when it worked okay, but now it throws an error.

Traceback: Traceback (most recent call last): File “C:\Python37\lib\site-packages\discord\client.py”, line 270, in _run_event await coro(*args, **kwargs) File “C:/Python37/Projects/Discord bot/bot.py”, line 55, in on_message await message.channel.send(file=file, embed=embed) File “C:\Python37\lib\site-packages\discord\abc.py”, line 806, in send content=content, tts=tts, embed=embed, nonce=nonce) File “C:\Python37\lib\site-packages\discord\http.py”, line 158, in request async with self.__session.request(method, url, **kwargs) as r: File “C:\Python37\lib\site-packages\aiohttp\client.py”, line 1005, in aenter self._resp = await self._coro File “C:\Python37\lib\site-packages\aiohttp\client.py”, line 497, in _request await resp.start(conn) File “C:\Python37\lib\site-packages\aiohttp\client_reqrep.py”, line 844, in start message, payload = await self._protocol.read() # type: ignore # noqa File “C:\Python37\lib\site-packages\aiohttp\streams.py”, line 588, in read await self._waiter aiohttp.client_exceptions.ClientOSError: [WinError 10054] An existing connection was forcibly closed by the remote host

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

System Information

  • Python v3.7.2-final
  • discord.py v1.2.3-final
  • aiohttp v3.5.4
  • websockets v6.0
  • system info: Windows 7 6.1.7601

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
gauravfifacommented, Feb 12, 2020

I have same issue but still can’t solve it .

1reaction
SobieskiCodescommented, Feb 12, 2020

I have same issue but still can’t solve it .

bigger hint: The problem is your internet and nothing to do with your code or how the code works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[WinError 10054] An existing connection was forcibly closed ...
I am trying aiohttp and asyncio first time and getting error like. [WinError 10054] An existing connection was forcibly closed by the remote...
Read more >
[WinError 10054] An existing connection was forcibly closed ...
An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly ......
Read more >
[Errno 10054] An existing connection was forcibly closed by ...
[Errno 10054] An existing connection was forcibly closed by the remote host while requesting images from URL. Hi, I tried to download the...
Read more >
Client Reference — aiohttp 3.8.3 documentation
Client session is the recommended interface for making HTTP requests. Session encapsulates a connection pool (connector instance) and supports keepalives by ...
Read more >
[Django] #30503: ConnectionResetError: [WinError 10054] An ...
#30503: ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found