Open dopeghoti opened 3 years ago
I may have a fix for this; it is in a separate branch while I test before I pull it into the mainline.
As an FYI, the LGBTea Cafe team is now also using the mentioned Dev branch. We'll let you know if we come across any issues 👍
Appreciate it. I have found that while it does help it does not fix the issue because that one location isn't the only one where Discord can throw an Exception at me, so I'll be updating that dev branch soon with more extensive exception handling to hopefully put a pin in this issue once and for all. Also I really love the name of your Team!
After almost a month of uptime the bot finally died again, so definitely the current version on the other branch is a great improvement.
I'm including the crash error below, in hops that that will provide some insight into the issue:
This is running on an Ubuntu 20.04.4 LTS
bare metal server, using an AMD Ryzen 3 2200G.
Unhandled exception in internal background task 'find_messages'.
Traceback (most recent call last):
File "./bot.py", line 241, in find_messages
msgs = await MonitorChannel.history().flatten()
File "/usr/local/lib/python3.8/dist-packages/discord/iterators.py", line 308, in flatten
data = await self._retrieve_messages(self.retrieve)
File "/usr/local/lib/python3.8/dist-packages/discord/iterators.py", line 348, in _retrieve_messages_before_strategy
data = await self.logs_from(self.channel.id, retrieve, before=before)
File "/usr/local/lib/python3.8/dist-packages/discord/http.py", line 192, in request
async with self.__session.request(method, url, **kwargs) as r:
File "/usr/local/lib/python3.8/dist-packages/aiohttp/client.py", line 1138, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.8/dist-packages/aiohttp/client.py", line 559, in _request
await resp.start(conn)
File "/usr/local/lib/python3.8/dist-packages/aiohttp/client_reqrep.py", line 913, in start
self._continue = None
File "/usr/local/lib/python3.8/dist-packages/aiohttp/helpers.py", line 721, in __exit__
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/discord/ext/tasks/__init__.py", line 101, in _loop
await self.coro(*args, **kwargs)
File "./bot.py", line 242, in find_messages
except DiscordServerError:
NameError: name 'DiscordServerError' is not defined
Stack trace from stderr follows:
Looks like it may be an upstream issue in
discord.py
but I might just had to do some exception handling.