Modmail icon indicating copy to clipboard operation
Modmail copied to clipboard

[BUG]: Future <Future pending> attached to a different loop.

Open Jerrie-Aries opened this issue 2 years ago • 0 comments

Bot Version

v4.0.0-dev14

How are you hosting Modmail?

Other

Error Logs

2022-06-24 17:13:03 __main__[189] - DEBUG: Successfully configured logging.
2022-06-24 17:13:03 __main__[148] - INFO: -------------------------
2022-06-24 17:13:03 __main__[149] - INFO: ┌┬┐┌─┐┌┬┐┌┬┐┌─┐┬┬
2022-06-24 17:13:03 __main__[150] - INFO: ││││ │ │││││├─┤││
2022-06-24 17:13:03 __main__[151] - INFO: ┴ ┴└─┘─┴┘┴ ┴┴ ┴┴┴─┘
2022-06-24 17:13:03 __main__[152] - INFO: v4.0.0-dev14
2022-06-24 17:13:03 __main__[153] - INFO: Authors: kyb3r, fourjr, Taaku18
2022-06-24 17:13:03 __main__[154] - INFO: -------------------------
2022-06-24 17:13:03 __main__[155] - INFO: discord.py: v2.0.0a
2022-06-24 17:13:03 __main__[156] - INFO: -------------------------
2022-06-24 17:13:05 core.clients[522] - DEBUG: Successfully connected to the database.
2022-06-24 17:13:05 core.clients[523] - DEBUG: -------------------------
2022-06-24 17:13:05 __main__[520] - DEBUG: Connected to gateway.
2022-06-24 17:13:05 core.config[280] - DEBUG: Successfully fetched configurations from database.
2022-06-24 17:13:05 core.clients[478] - DEBUG: Successfully configured and verified database indexes.
2022-06-24 17:13:05 __main__[160] - DEBUG: Loading cogs.modmail.
2022-06-24 17:13:05 __main__[163] - DEBUG: Successfully loaded cogs.modmail.
2022-06-24 17:13:05 __main__[160] - DEBUG: Loading cogs.plugins.
2022-06-24 17:13:05 cogs.plugins[243] - DEBUG: Downloading requirements for [email protected].
2022-06-24 17:13:06 __main__[1508] - ERROR: Ignoring exception in on_ready.
2022-06-24 17:13:06 __main__[1509] - ERROR: Unexpected exception:
Traceback (most recent call last):
  File "/User/Project/modmail/.venv/lib/python3.9/site-packages/discord/client.py", line 375, in _run_event
    await coro(*args, **kwargs)
  File "/User/Project/modmail/bot.py", line 530, in on_ready
    await self.wait_for_connected()
  File "/User/Project/modmail/bot.py", line 370, in wait_for_connected
    await self._connected.wait()
  File "/bin/python3-3.9.6/lib/python3.9/asyncio/locks.py", line 226, in wait
    await fut
RuntimeError: Task <Task pending name='discord.py: on_ready' coro=<Client._run_event() running at /User/Project/modmail/.venv/lib/python3.9/site-packages/discord/client.py:375>> got Future <Future pending> attached to a different loop
2022-06-24 17:13:15 cogs.plugins[260] - INFO: Loaded plugin: logviewer
2022-06-24 17:13:15 cogs.plugins[166] - DEBUG: Finished loading all plugins.
2022-06-24 17:13:15 [email protected][176] - INFO: Starting log viewer server.
2022-06-24 17:13:15 __main__[163] - DEBUG: Successfully loaded cogs.plugins.
2022-06-24 17:13:15 __main__[160] - DEBUG: Loading cogs.utility.
2022-06-24 17:13:15 __main__[163] - DEBUG: Successfully loaded cogs.utility.
2022-06-24 17:13:15 __main__[166] - DEBUG: -------------------------
2022-06-24 17:13:15 cogs.utility[645] - INFO: -------------------------
2022-06-24 17:13:15 cogs.utility[654] - INFO: Activity set to: Playing Coding..
2022-06-24 17:13:15 cogs.utility[661] - INFO: No status has been set.

Screenshots

No response

Additional Information

Steps to reproduce:

  • Install any plugin that has some requirements to download (that makes loading extension cogs/plugins.py at startup take some time).
  • Restart the bot and see if the error occurs.

This is a rare bug that at first I wasn't really sure what causes the issue and how to reproduce.

The logs just stuck there and everything in on_ready() is not executed.

Jerrie-Aries avatar Jun 24 '22 17:06 Jerrie-Aries