Skip to content

[BUG] RuntimeError from phishingdetection cog when unloading #271

Description

@tigattack

Describe the bug

I noticed this when restarting the bot and haven't looked into it. Could be transient, could be a simple fix, idk, just logging so it's logged and I don't forget forever.

To Reproduce
Steps to reproduce the behavior:

  1. Load cog
  2. Unload cog

Expected behavior

Not this I guess.

Screenshots

Additional context

Logs:

[2024-07-30 21:43:13] [ERROR] discord.ext.commands.cog: Ignoring exception in cog unload for Cog <class 'phishingdetection.phishingdetection.PhishingDetectionCog'> ('PhishingDetectionCog')
Traceback (most recent call last):
  File "/redbot/.local/lib/python3.11/site-packages/discord/ext/commands/cog.py", line 776, in _eject
    await maybe_coroutine(self.cog_unload)
  File "/redbot/.local/lib/python3.11/site-packages/discord/utils.py", line 692, in maybe_coroutine
    value = f(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^
  File "/redbot/data/cogs/CogManager/cogs/phishingdetection/phishingdetection.py", line 68, in cog_unload
    self.bot.loop.run_until_complete(self.session.close())
  File "uvloop/loop.pyx", line 1511, in uvloop.loop.Loop.run_until_complete
  File "uvloop/loop.pyx", line 1504, in uvloop.loop.Loop.run_until_complete
  File "uvloop/loop.pyx", line 1377, in uvloop.loop.Loop.run_forever
  File "uvloop/loop.pyx", line 518, in uvloop.loop.Loop._run
RuntimeError: this event loop is already running.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cog-phishdetectIssues related to the phishingdetection cog.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions