-
Notifications
You must be signed in to change notification settings - Fork 113
The bot randomly stops playing when using Docker #71
Comments
Hey there, how are you starting up the container? Are you using the docker-compose file I showed you before or are you using the docker-cli directly to create one? |
I am using the docker-compose file you showed me, and then starting it with docker-compose up -d. |
Can you try running |
This time, it did not crash. It did however start playing up and as a result the playback stopped. Here are a few weird behaviors I am noticing:
I did notice that there is no option to carry on playing even when the voice channel is empty. When I ran the bot through VSCode, this is what fixed all the issues. How do I do this when running it on Docker? |
Here is the log up until the first crash:
|
The stream expire warning shows up when the bot resumes playback after it has been paused for like longer than an hour or two, so it skips to the next song. You can enable the playback even when the channel is empty by adding the environment variable:
|
Wonderful, thank you for that. I have made the relevant changes and started the bot up again. I will keep an eye on it for the next few days and report back here to see if it has fixed the error! |
Very weird, I would expect an error to show up. It kinda seems like the container got restarted manually. In any case, I do not remember if you were the person who told me about the PAUSE_ON_EMPTY setting, because if you disable the whole pause functionality almost all random crashing is gone. But yeah, if you do not care about using some bandwidth constantly, disabling the pause on empty function actually works well. |
Yeah I was the one who posted about disabling the PAUSE_ON_EMPTY setting as it fixed all the issues I was having with playback as it would struggle to resume at times. Bandwidth is not much of a problem thankfully, I run on unlimited which makes server hosting a lot easier. |
Yeah, just as a reminder, you can configure the bot through environment variables inside your docker-compose.yml file, you can check what variable corresponds to what JSON config key here. |
So it is happening again. It seems to start randomy playing this Goslow song which then has no sound
|
After this line appears, it stops playing music:
I have no clue where that song is coming from, but if I can remove it then I believe the issue will be fixed. I will confirm this by doing !skip to see if skipping it fixes the bot. |
I am trying all available file types to see if it might be something to do with that. Will update if it crashes again. |
@moonstar-x that seems to be the issue. I tried another file format (mp3) and it did the same. Instead, with the mp3 files it now just says presence updated to with no song. |
It doesn't say "Presence updated to: Local song"? |
When I switch my files from .OPUS to .MP3, it does. The logs I posted before were before I changed the file format. Now that I have .mp3 files, it simply says |
Do you mean that just by changing the extension from |
I did not just change the file extension. I redownloaded all the songs in .mp3 format. Previously, when I was using .OPUS format, the bot would stop playing once it updated its presence to |
So I came to the conclusion that the bot is attempting to play songs that are not there, hence its stopped playback |
Hmmm... It rather seems interesting that the presence gets changed to Though, I've seen some filesystems that create hidden files for certain files, so if you have a file If you go to your |
I tried everything and I am still not able to see any hidden files. I turne don the show hidden files option, run commands on PowerShell and CMD that show all files including hidden and it just lists all songs I have added. |
It seems to happen on song 10/12. I will keep a eye on it to triple check this. |
For some reason, all it says now is |
I do get this on start up:
However, it is definitely not on any other server as I only own this one. |
Are you really sure your bot is in only one server? If you're getting that message it surely means that it is indeed in 2 servers. Although it shouldn't be too much of a problem since the bot only connects to the channel you tell it to connect (which means obviously one server only) but I'm actually not 100% if just the fact of being in multiple servers is enough to break the player. Though I know that the However, I can't really explain why the presence would get updated to something empty when there is no way that the PlayerPresenceManager returned something empty like that unless the player had some sort of unexpected state. If it's not something related to the files being corrupt or having broken metadata, it could be that the second server is breaking the player. Try remaking your bot in the developer portal or, if you're comfortable with code, leaving all the servers your bot is in and then re-inviting it. client.on('ready', () => {
Promise.all(client.guilds.cache.map((guild) => guild.leave())).then(() => console.log('Finished leaving'));
}); |
Thank you for that all. I am going to get the bot to leave all the servers before I try anything else. From there on, if that does not work, I shall remake it in the developer portal. In terms of the code, where should I put that? |
You can put that anywhere inside |
After running the code, getting the bot to leave all servers, and inviting it back the issue still persists. The error message did go away though. |
Even after getting it to leave the server, every single song just shows:
I think this has to do with metadata or something along that line because it now can not find information about the song and as always attempts to play a song that is not there hence the silence. |
That's weird. I'm convinced that you must have an audio file that may be hidden, if not in the As for the metadata thing, I think it's better that it says 'Local song' and not an empty string because at least the metadata parser worked but didn't find anything. I cannot reproduce your issue either. I do not get any moment when the bot plays silence or when the metadata doesn't work with opus files. |
Alright so I kicked the bot, invited it back, started the project from scratch, only had one song that worked and started it. Turns out the metadata issue was due to the songs completely loosing their information. So I fixed that. Now, the bot will play perfectly for a day or so (playing through terminal now instead of docker), and then just play nothing at all. The presence shows the song with the right tags and information, but in the server it is dead silent. |
I'm aware of that particular issue. Normally the stream expire thing should deal with it but I know it is not perfect. I think this can be fixed with the update to djs13 but I'm afraid I haven't found the time to work on this. :/ |
I wonder if there is a way to have the program self restart before the time that it would normally expire, for now. |
Hi there, sorry for the long hiatus, I'm trying to make some time during my week for these things. After some thought it seems that this is a duplicate of #56 so I'm closing this issue. |
🐛 Describe the Bug
✏️ Steps to Reproduce
😕 Expected Behavior
📜 Log
📷 Screenshots
❓ Other Information
Version of the node runtime.
The text was updated successfully, but these errors were encountered: