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
d.js toolkit
d.js toolkit5mo ago
WhoAboutYT :3
WhoAboutYT :35mo ago
Discord changed supprorted voice encryption methods.
Chiko0401
Chiko0401OP5mo ago
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
WhoAboutYT :3
WhoAboutYT :35mo ago
Youre talking about the pipe issue, right?
Chiko0401
Chiko0401OP5mo ago
@WhoAboutYT :3 Yes, EPIPE It is a very weird timing. After I upgraded all packages, it is started happening
WhoAboutYT :3
WhoAboutYT :35mo ago
Im assuming you use ffmpeg in your program?
Chiko0401
Chiko0401OP5mo ago
Correct
WhoAboutYT :3
WhoAboutYT :35mo ago
on every stream try placing an error event, with the callback as console.err
Chiko0401
Chiko0401OP5mo ago
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
WhoAboutYT :3
WhoAboutYT :35mo ago
:thumbsup:
Chiko0401
Chiko0401OP4mo ago
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

Did you find this page helpful?