• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

Discord no music/sound (maybe changed Discord Voice API)

nerzlakai96

Member
Hello,
today i found out that my Sinusbot Discord stopped playing music or sounds in his channel. In his webpanel, it still shows he's playing the song at the moment and everything, but there is just no music/sound coming out of the Sinusbot. It worked flawless the last couple of months and i didn't change anything that could be related with this issue.

It seems this may be the reason:
https://forum.sinusbot.com/threads/discord-no-music.7404/#post-42511

Sinusbot Version: 1.0.1
Linux Debian 11


Thanks in advance and kind regards,
nerzlakai96
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Hey and thanks for the report! A fixed version is already available here. I'll update links on the forum soon as well.
 

Hitman_

Member
Hey and thanks for the report! A fixed version is already available here. I'll update links on the forum soon as well.
Hello, I can also confirm that the same problem is happening on Windows version of Sinusbot. Is there a fixed version for Windows ?

Thanks.
 

Lala Sabathil

Donor
is awesome!
Contributor
Insider
Hello, I can also confirm that the same problem is happening on Windows version of Sinusbot. Is there a fixed version for Windows ?

Thanks.
No there won’t be a fix for the windows version in near future. I highly recommend to switch to Linux.
 

nerzlakai96

Member
Thank you :) So generally it works again, but i still have an issue and i don't know if it's just me or everyone else.
When the Sinusbot starts and gets online on Discord, it works in the beginnung, but after some time online, it'll start generating some of these error messgages:
2023-03-22T20:24:41+01:00 voice handler returned with: error from voice reader: websocket: close 4014: Disconnected.
and
2023-03-22T20:40:28+01:00 voice handler returned with: error from voice reader: websocket: close 1006 (abnormal closure): unexpected EOF
and it gets silent again like before the update.
 

nerzlakai96

Member
Update to my post from yesterday: After some testing i found out that this bug appears to start when the Sinusbot on Discord moves or gets moved to another voice channel. In most occasions the Bot stays silent afterwards and has to be restarted.
 

FourPro

Active Member
Update bot for version 1.0.2 in log:
2023-03-25T10:09:09+03:00 state instable for discord connection
ping is jumping, at least yesterday, I'll look at it today
everything is fine with the server network
 

nerzlakai96

Member
Thank you for your time and your help :)
Your idea was actually really good, but unfortunatley after some in depth testing, it still remains the same problem.
I still think this is a bug in the current version 1.0.2 listed here:
When the event 'VOICE_STATE_UPDATE' of Discord triggers by changing Voice Channels, it reestablishes a connection to the Websocket of Discord, but most of the time this fails and results in errors like...
"2023-03-25T14:54:38+01:00 voice handler returned with: error from voice reader: websocket: close 4014: Disconnected."
and the Bot gets silent again.

Interesting to mention is that i don't need to restart the Sinusbot in order make it work again, i just need to move the Bot to another Voice Channel or make him move until the 'Hankshake' with the Websocket successfully establishes again and Voila the sound is back boys.

Hopefully there is a kind of fix for it soon. Would be very grateful and i'm willing to provide more info if needed :)
 

FourPro

Active Member
I threw off the log, it's not about the error that you specify)) after the diagnosis, I noticed that a foreign location was being used, I put my own, now it works better while I check
 

nerzlakai96

Member
I threw off the log, it's not about the error that you specify)) after the diagnosis, I noticed that a foreign location was being used, I put my own, now it works better while I check
Hey, so you don't have the issue i am experiencing at the moment with disconnecting Voice when changing channel of the Sinusbot in Discord?
What do you exactly mean with "foreign location was being used, I put my own, now it works better"?

I am about to go mad about this, because i never had these kind of issues before and after days now of testing it still can't make it work properly.

Thanks in advance and kind regards
 

FourPro

Active Member
I solved this problem like this: I set the task to restart every 30 minutes) but the bot swears at an unstable connection)
 

Soulivan71

Member
Same issue, even if I put auto restart every 2h, and then when the ot crash, my panel crash too, I need to restart the service its annoying discord bug...
 

nomyn

Member
Thank you nerzlakai96! I was struggling with this problem but your post helped to identify the actual issue from the logs. This is very annoying as the bot suddenly goes mute at random times. Daily restart alone couldn't solve this.

Based on this error string "voice handler returned with: error from voice reader: websocket: close" it was possible to write bash script to automatically restart the bot every time this happens. Seems that there are different error codes and I left that part out of the search so this would hopefully handle all errors and so far so good. I will share the script at the end of this post.

For this script to work:
  1. Activate logging to file from sinusbot "config.ini" file.
    1. Set LogLevel = 3
    2. Set path for file for example LogFile = "/logs/sinusbot/sinusbot.log" (make sure sinusbot-user has rights to this folder)
    3. Restart sinusbot service to activate logging to file
  2. Change correct file paths to script.
    1. Set variable logFilePath value to same you have for sinusbot.log (step 1.2.)
    2. Variables tempFile and monitorLogFile can be anywhere you want
  3. (Optional) sinusbot.service?
    1. You may have different name for the service, fix line "systemctl restart sinusbot.service" according to this.

Script content below, save to .sh file and grand run privilege with "chmod +x yourFile.sh". I have set this script to be run every minute with cronjob so the bot will be recovered pretty much immediately.

#!/bin/bash
#variables
logFilePath="/logs/sinusbot/sinusbot.log"
tempFile="/logs/sinusbot/tempLog.txt"
monitorLogFile="/logs/sinusbot/monitorLog.txt"
#tail into temp file
tail -20 $logFilePath > $tempFile
#look into log file
if grep -q "voice handler returned with: error from voice reader: websocket: close" "$tempFile"; then
#restart the bot and log the event
systemctl restart sinusbot.service
dt=$(date '+%d/%m/%Y %H:%M:%S')
echo "$dt - Sinusbot restarted automatically." >> $monitorLogFile
fi
 

Valeriah

Member
Update to my post from yesterday: After some testing i found out that this bug appears to start when the Sinusbot on Discord moves or gets moved to another voice channel. In most occasions the Bot stays silent afterwards and has to be restarted.
This is exactly the problem that still persists



Hey and thanks for the report! A fixed version is already available here. I'll update links on the forum soon as well.
This still has the same problem as above



This did not solve the problem
 
Top