[Core] Crash | Red 3.3.1 #3560

Closed
opened 2020-02-17 13:02:46 +01:00 by Menteroth · 3 comments
Menteroth commented 2020-02-17 13:02:46 +01:00 (Migrated from github.com)

Other bugs

What were you trying to do?

Use shutdown or restart (using batch file for Windows).
When using restart and the batch file it just repeats for 4-5 seconds until it finally starts the bot again.

What were you expecting to happen?

For the bot to exit/restart properly.

What actually happened?

[2020-02-17 12:47:01] [INFO] red.main: Shutting down with exit code: ExitCodes.SHUTDOWN
[2020-02-17 12:47:01] [INFO] red.main: Please wait, cleaning up a bit more
[2020-02-17 12:47:03] [CRITICAL] red.main: Caught unhandled exception in task: 'NoneType' object has no attribute 'id'
[2020-02-17 12:47:03] [CRITICAL] red.main: Caught unhandled exception in task: 'NoneType' object has no attribute 'id'
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000000002CBA670>
Traceback (most recent call last):
  File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 715, in call_soon
    self._check_closed()
  File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

After this it starts to repeat until starting the bot again, or just ends, after the repeats, if using shutdown.

How can we reproduce this issue?

Not a clue.

# Other bugs <!-- Did you find a bug with something other than a command? Fill out the following: --> #### What were you trying to do? Use `shutdown` or `restart` (using batch file for Windows). When using restart and the batch file it just repeats for 4-5 seconds until it finally starts the bot again. #### What were you expecting to happen? For the bot to exit/restart properly. #### What actually happened? ``` [2020-02-17 12:47:01] [INFO] red.main: Shutting down with exit code: ExitCodes.SHUTDOWN [2020-02-17 12:47:01] [INFO] red.main: Please wait, cleaning up a bit more [2020-02-17 12:47:03] [CRITICAL] red.main: Caught unhandled exception in task: 'NoneType' object has no attribute 'id' [2020-02-17 12:47:03] [CRITICAL] red.main: Caught unhandled exception in task: 'NoneType' object has no attribute 'id' Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000000002CBA670> Traceback (most recent call last): File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__ self.close() File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close self._loop.call_soon(self._call_connection_lost, None) File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 715, in call_soon self._check_closed() File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed ``` After this it starts to repeat until starting the bot again, or just ends, after the repeats, if using shutdown. #### How can we reproduce this issue? Not a clue.
mikeshardmind commented 2020-02-17 17:58:25 +01:00 (Migrated from github.com)

https://bugs.python.org/issue39232

This is the first I've seen this issue come up since we started manually handling closing the event loop (see BPO above for why) and wait 2 seconds for outstanding transports to be closed. That may not sound like much time, but considering that waiting happens after canceling out everything else the bot is doing, we expected it to be enough. We can't go much higher than this without running into issues with process managers killing services that don't close when told to do so.

https://bugs.python.org/issue39232 This is the first I've seen this issue come up since we started manually handling closing the event loop (see BPO above for why) and wait 2 seconds for outstanding transports to be closed. That may not sound like much time, but considering that waiting happens after canceling out everything else the bot is doing, we expected it to be enough. We can't go much higher than this without running into issues with process managers killing services that don't close when told to do so.
Menteroth commented 2020-02-17 18:06:24 +01:00 (Migrated from github.com)

I'm sorry. Don't really understand all of that stuff and what you said.
Just wanted to share what was happening.

I'm sorry. Don't really understand all of that stuff and what you said. Just wanted to share what was happening.
Flame442 commented 2022-09-26 23:03:39 +02:00 (Migrated from github.com)

This is a dependency issue, and is fixed in Python 3.10.

This is a dependency issue, and is [fixed in Python 3.10](https://github.com/python/cpython/pull/92842).
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#3560
No description provided.