Modmail icon indicating copy to clipboard operation
Modmail copied to clipboard

[BUG]: ExtensionAlreadyLoaded error when the bot internally restarting.

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

Bot Version

v4.0.0-dev16

How are you hosting Modmail?

Other

Error Logs

See below.

Screenshots

No response

Additional Information

Per title, this error is raised when the bot restarting/reconnecting internally.

Error:

2022-07-12 07:07:47 cogs.utility[639] - DEBUG: Resetting presence.
2022-07-12 07:10:46 core.clients[522] - DEBUG: Successfully connected to the database.
2022-07-12 07:10:46 core.clients[523] - DEBUG: -------------------------
2022-07-12 07:10:46 __main__[521] - DEBUG: Connected to gateway.
2022-07-12 07:10:46 core.clients[478] - DEBUG: Successfully configured and verified database indexes.
2022-07-12 07:10:46 __main__[160] - DEBUG: Loading cogs.modmail.
2022-07-12 07:10:46 __main__[165] - ERROR: Failed to load cogs.modmail.
Traceback (most recent call last):
  File "/Users/Projects/Modmail/bot.py", line 162, in load_extensions
    await self.load_extension(cog)
  File "/Users/Projects/Modmail/.venv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 989, in load_extension
    raise errors.ExtensionAlreadyLoaded(name)
discord.ext.commands.errors.ExtensionAlreadyLoaded: Extension 'cogs.modmail' is already loaded.
2022-07-12 07:10:46 __main__[160] - DEBUG: Loading cogs.plugins.
2022-07-12 07:10:46 __main__[165] - ERROR: Failed to load cogs.plugins.
Traceback (most recent call last):
  File "/Users/Projects/Modmail/bot.py", line 162, in load_extensions
    await self.load_extension(cog)
  File "/Users/Projects/Modmail/.venv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 989, in load_extension
    raise errors.ExtensionAlreadyLoaded(name)
discord.ext.commands.errors.ExtensionAlreadyLoaded: Extension 'cogs.plugins' is already loaded.
2022-07-12 07:10:46 __main__[160] - DEBUG: Loading cogs.utility.
2022-07-12 07:10:46 __main__[165] - ERROR: Failed to load cogs.utility.
Traceback (most recent call last):
  File "/Users/Projects/Modmail/bot.py", line 162, in load_extensions
    await self.load_extension(cog)
  File "/Users/Projects/Modmail/.venv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 989, in load_extension
    raise errors.ExtensionAlreadyLoaded(name)
discord.ext.commands.errors.ExtensionAlreadyLoaded: Extension 'cogs.utility' is already loaded.
2022-07-12 07:10:46 __main__[166] - DEBUG: -------------------------
2022-07-12 07:10:48 __main__[539] - INFO: -------------------------
2022-07-12 07:10:48 __main__[540] - WARNING: Bot restarted due to internal discord reloading.
2022-07-12 07:10:48 __main__[541] - INFO: -------------------------

Not sure whether this should be handled or left out as is.

Jerrie-Aries avatar Jul 18 '22 09:07 Jerrie-Aries