#Lavalink "Connection reset" & Shoukaku "Session not found" Errors

1 messages · Page 1 of 1 (latest)

livid drift
#

I'm occasionally encountering this Lavalink error:

2025-05-03T21:13:47.966Z ERROR 1 --- [Lavalink] [ntLoopGroup-2-1] lavalink.server.io.SocketContext         : Koe encountered a voice gateway exception for guild 788729764592353310

java.net.SocketException: Connection reset
    at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(Unknown Source) ~[na:na]
    at java.base/sun.nio.ch.SocketChannelImpl.read(Unknown Source) ~[na:na]
    at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:255) ~[netty-buffer-4.1.112.Final.jar!/:4.1.112.Final]
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[netty-buffer-4.1.112.Final.jar!/:4.1.112.Final]
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:356) ~[netty-transport-4.1.112.Final.jar!/:4.1.112.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) ~[netty-transport-4.1.112.Final.jar!/:4.1.112.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.112.Final.jar!/:4.1.112.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.112.Final.jar!/:4.1.112.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.112.Final.jar!/:4.1.112.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.112.Final.jar!/:4.1.112.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994) ~[netty-common-4.1.112.Final.jar!/:4.1.112.Final]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.112.Final.jar!/:4.1.112.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.112.Final.jar!/:4.1.112.Final]
#

At the same time, my Shoukaku client throws this error when trying to create a player:

[4/29/2025] [4:57:55 AM] [Queue.js] › ✖  error     An error occured while creating the player for guild 1366466838992519298 RestError: Session not found     at Rest.fetch (file:///opt/wavemusic/node_modules/shoukaku/dist/index.mjs:964:13)     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)     at async Player.sendServerUpdate (file:///opt/wavemusic/node_modules/shoukaku/dist/index.mjs:708:5)     at async ShoukakuClient.joinVoiceChannel (file:///opt/wavemusic/node_modules/shoukaku/dist/index.mjs:1302:7)
 {   timestamp: 1745902675168,   status: 404,   error: 'Not Found',   trace: undefined,   path: '/v4/sessions/hhdo3b0pzwvc6f4t/players/1366466838992519298' }
#

I know the Lavalink Koe encountered a voice gateway exception issue has been reported before, often tied to high server load or unstable internet connections. I'm currently trying to find a way to handle these errors gracefully without restarting the Lavalink server, but haven’t had success yet.

If anyone has strategies for dealing with these issues I’d appreciate any advice.

raw flax
#

can you show more of your lavalink logs around this error?

#

looks like your client disconnected from lavalink

#

else you wouldnt get an error saying the session is not found

#

you could try setting moe.kyokobot.koe.gateway: DEBUG too

livid drift
raw flax
#

you might want to change your node password

#

and not enable header logging

livid drift
#

ahh f

livid drift
raw flax
livid drift
raw flax
#

that would make sense

#

I have the same thing lel

#

havent tested that tho

livid drift
#

i have resuming enabled but it is not always working in that case

raw flax
#

Well I assume your bot runs locally too

#

So resuming doesn't do anything

livid drift
#

also it's not happening every day (every 24h). sometimes it works without any issues and sometimes not

raw flax
#

Since the connection between your bot & lavalink never drops, assuming you use local ips

livid drift
#

yeah, excepted for one node that runs on an external server and there I never had the error, but maybe because it has a lot more capacity and power

raw flax
#

Well the internet connection also doesn't drop every 24h

#

¯_(ツ)_/¯

#

And an IP change

#

Resuming should at least make sure it doesn't kill your lavalink session

#

So as long you got that enabled and implemented the remote server should run fine

livid drift
#

yes that should work

#

but i am still not sure what's the best way to handle the "session not found" error. do you know if shoukaku has inbuilt functions to create a new session or do i have to make my own handler?

raw flax
#

I have no idea of any js client

#

it would be interesting to see to where this request is done

#

because I cant see it in your lavalink log

livid drift
#

yeah, I got the lavalink error multiple times, but I accidentally copied the wrong one where I didn't have the shoukaku issue. I’ll look for the correct error log tomorrow.

raw flax
livid drift
#

network issues started at: 2025-05-03T21:09:42.324Z
and ended at: 2025-05-03T21:13:56.155Z

#

for how long is resuming possible?

raw flax
livid drift
#

Just checked it. Resuming shouldn’t be an issue.

#

And for the "Session not found" error I will just try to remove and re-add the node and hopefully get a new session

#

Have to try it later

stable spear
#

whats most likey happening is ur node and bot are losing connection

#

and then it doesnt reailze and trys old sessions that dont exist anymore

livid drift
#

ah no. i can just do node.disconnect() and node.connect() i think

stable spear
#

Or kill all players on a node disconnect of u don’t do resuming, and recreate them

#

But ur connection reset and other issues

#

Just scream unstable network

livid drift
# stable spear Improve ur network

But why is this only happening to the nodes that are on the same network as the bot? They're all connected via LAN to the same switch, so there shouldn't be any issues. Strangely, the node that's outside this network has never experienced this problem and the bot never disconnected from that node. It just doesn't make sense.

stable spear
livid drift
#

Just wondering why the connection to the node outside of this network is stable 🤔

stable spear