I took a look at ~cmb a couple of times yesterday, and I do see the unexpected restarts. I was going to suggest you instrument your modules with log messages and also log the shutdown call (a la Ways to comunicate with glitch) to see if there are some patterns about what your bot is doing before it gets shut down. I don’t see anything useful in our logs but haven’t given up just yet.
Just going to add, the reason I have decided to move away from glitch for nodejs projects is completely unrelated to any problems I was having, it is due to the fact that my bot is growing to a point where I feel its better hosting it on my vps!
The only thing that’s bad for me that the projects sleep too soon (in 5-10 minutes) that music functions cannot be used easily since the bot stops playing music when restarting for no reason. I’m online all day and see it restarting again and again.
From a Discord Bot Developer and Glitch User,
TehPig_YT
I was saying that you can trap the exit signal Glitch sends to your project when it’s shutting down (before it starts up again) so you can tell when Glitch told the project to shut down. Combine that with some console.log statements in the various methods inside the bot and you can get an idea of what the bot has been doing. It’s possible that something in one of this bot’s commands is triggering a restart for some unknown reason - knowing what the last few commands that were executed before the restart are might help figure out what’s going on.
Um… I don’t think that a bot’s command is causing the restart. I’ve left the bot playing music with me in it and without a reson, it restarts and no one is using the bot’s commands. I can tell that for sure. I’m sorry if I haven’t still understood. And it’s not that the music system is causing the problem because it’s functioning pretty good until the bot stops working (also stops the playing song). And I really want to stay on Glitch because Glitch has offered me a lot and I want still to support it and help me with it’s own way.
From a Discord Bot Developer and Glitch User,
TehPig_YT
I haven’t looked at your project at this point; I don’t even know that project name. And I’m not talking only about bot commands - just knowing what code the bot last executed before it restarted, whether that’s a command or something else entirely, might help figure out what’s causing the restart.
For instance, exceeding CPU or memory limits could cause a restart, and it’s possible some of those paths aren’t logging useful data. Knowing what sorts of activities preceded a restart might be useful to know and is about the only thing I can think of right now to help figure out why a specific project is restarting.
Here’s the current container’s stats.
I can send an invite if you can check it. Because I’m really desperate right now about this topic.
And it’s really important to me to be solved (if it can) with the best possible way.
Project Name: t-moderator-bot
From a Discord Bot Developer and Glitch User,
TehPig_YT
Music bots usually take up alot of memory on glitch, where it gets to the point that your project forcefully restarts itself after 15 seconds, this could be what is happening!
Yes but when I have it in a project with only music commands, it works fine. I’ve checked it since I was using another bot for the music system before this one.
From a Discord Bot Developer and Glitch User,
TehPig_YT
And I think that the problem now has been fixed successfully! Thank you for your support @Callum and our beloved @cori that has helped me at least 5 times to solve my problems! Thank you very much! Final Result: Problem was mine and not Glitch’s.
From a Discord Bot Developer and Glitch User,
TehPig_YT