freyacodes / archived-bot

A Discord music bot serving music in over 3 million discord servers
https://fredboat.com/docs
MIT License
488 stars 210 forks source link

Bot got stuck in connecting to VC after discord server crash #604

Open wastae opened 4 years ago

wastae commented 4 years ago

After my discord server is crashed and it started again, bot can't join to VC, only after rebooting shard it can join again.

idk it's happening on main FredBoat or not, but i think this is issue in code.

wastae commented 4 years ago

What info need?

Here's some log:

[GuildPlayer] Connected to voice channel [VC:Valhalla:672894339030057000]
[SentinelLink] 400215724184043530: Lavalink voice WS closed by Discord, code 4006: Session is no longer valid.
[SentinelLink] 400215724184043530: Queuing new voice connection after expired session from Sentinel

And after this nothing happening. Tried commands like destroy and unsub, but only after restart shard it work.

In sentinel it only saying that it subscribed to guild, but it not trying to join in voice channel. Usually it logging this when connecting:

[JDA [0 / 1] MainWS-ReadThread] c.f.s.jda.VoiceServerUpdateInterceptor   : {"endpoint":"eu-central420.discord.media:80","guild_id":"400215724184043530","token":"be2bb67c1a4d698d"}
freyacodes commented 4 years ago

What info need?

As a general rule we cannot help you without logs. Version info also helps.

Lavalink voice WS closed by Discord, code 4006: Session is no longer valid.

I've heard of this happening repeatedly. You could try restarting lavalink.

docker-compose restart lavalink

wastae commented 4 years ago

This happening only after temporary discord server disabling and if i restart lavalink it drop all current music connections in other servers where everything okay, i still think this is issue, because this maybe happening on FredBoat too

freyacodes commented 4 years ago

I am aware of the issue. I know someone is currently looking into it. We think a library is to blame.

I am not sure exactly what happens if you restart lavalink and it is the only one in use. Your users might just need to have the bot rejoin and unpause.

Or you could try the ;;destroy command.

wastae commented 4 years ago

Tried commands like destroy and unsub, but only after restart shard it work.

I writed that i tried already, only restarting shard with revive command helped with this issue. Also thanks for response and hope this will be fixed soon!