discord-tickets / bot

The most popular open-source and self-hosted ticket management bot for Discord - a free alternative to the premium and white-label plans of other popular ticketing bots.
https://discordtickets.app
GNU General Public License v3.0
898 stars 473 forks source link

[BUG] Some errors cause memory leaks and crashes #436

Closed eartharoid closed 8 months ago

eartharoid commented 1 year ago

Is there an existing issue for this?

Current Behavior

https://github.com/discord-tickets/portal/issues/5 Some uncaught errors don't end up being handled by the unhandledRejection listener and instead, cause 100% CPU and RAM usage.

Might be related to errors thrown in .map(), .forEach() etc.

Expected Behavior

Errors should either be caught and handled correctly or be handled by the unhandled process event listeners without causing a problem.

Steps To Reproduce

No response

Environment

- OS:
- Node:
- NPM:
- Bot: 4.0.3

Anything else?

😢

GameAreaCZ commented 1 year ago

When I create a panel with only one category everything is working fine. When I take all 6 categories (so it will be a menu) and I choose whatever category to post a ticket in, it is starting using 100% cpu and more and more RAM and then it crashes without an error. Maybe is connected with this error?

eartharoid commented 1 year ago

@GameAreaCZ the CPU and memory usage increase would be this. Are you sure it is just going from a button to a menu that changed though? It's more likely to be https://github.com/discord-tickets/portal/issues/5.

GameAreaCZ commented 1 year ago

Ofcourse you are right. It was exactly like that. Two from six categories that I have had that empty (not None but empty completely). I changed that to None and it is working.

Thank you very much.

eartharoid commented 1 year ago

This might have been fixed by https://github.com/discord-tickets/bot/commit/e8b95a2f3149fab08ed3c927f771d8ee4fad9d04

eartharoid commented 8 months ago

Appears to be fixed.