aiohttp.client_exceptions.ClientOSError: [WinError 10054] An existing connection was forcibly closed by the remote host
See original GitHub issueSummary
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:
- Created 4 years ago
- Comments:6
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.