EPIPE after upgrading NodeJs from 16 to 22
Hi,
We started getting this error "No compatible encryption modes. Available include: aead_aes256_gcm_rtpsize, aead_xchacha20_poly1305_rtpsize" a few month ago.
Because of it we upgraded all libraries include discord.js(14.11 -> 14.21), discordjs/voice (0.16 -> 0.18), nodejs (16 ->22) and started to get this error
[2025-07-10T11:45:47.358] [ERROR] bot - Uncaught Exception thrown Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:87:19) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}
[2025-07-10T11:45:47.362] [ERROR] bot - Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:87:19)
This error sometimes crashes the bot since it happens somewhere in NodeJs and from the stacktrace we can't understand how it is related to our code.
Any help will be useful, even only to understand how to catch it w/o solving it.
Our bot is running on 5000+ guilds.
11 Replies
Discord changed supprorted voice encryption methods.
I know. Therefore I upgraded all my packages to the latest ones, but now I have the "crashing" probelm...
@WhoAboutYT :3 Now I don't have problems with encryption, but I have a worse problem
Youre talking about the pipe issue, right?
@WhoAboutYT :3 Yes, EPIPE
It is a very weird timing. After I upgraded all packages, it is started happening
Im assuming you use ffmpeg in your program?
Correct
on every stream try placing an error event, with the callback as console.err
I was wrong. I don't use ffmpeg anymore:
pipeline(opusStream, oggStream, dataWriteStream)
I store ogg as is.
But you are right I will re-check that all my streams are wrapped with callback.
I will update here soon
:thumbsup:
Hi @WhoAboutYT :3 As I promise, I update you here. I found where the problem is, but I don't know how to solve it still.
I have opened a ticket about it - https://stackoverflow.com/questions/79716970/write-epipe-after-upgrade-node-js#79716970