@discordjs/proxy-container intermittently crashing

Hi, I use this package to proxy my cloudflare worker requests since I was getting 1015s while trying to use the OAuth callback endpoint (ugh!). It's been working great up until a few days ago when all of a sudden a small percentage of requests began to return 1015s anyway, along with (I assume they happen at the same time) a crash. I have tried re-pulling the container in case there had been an update made but that didn't help sadly. Docker command:
docker run --restart unless-stopped -d --name discord-proxy -p 0.0.0.0:3200:8080 discordjs/proxy
docker run --restart unless-stopped -d --name discord-proxy -p 0.0.0.0:3200:8080 discordjs/proxy
log:
# server starts
Listening on port 8080
node:internal/process/promises:394
triggerUncaughtException(err, true /* fromPromise */);
^

Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
at onclose (node:internal/streams/end-of-stream:162:30)
at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {
code: 'ERR_STREAM_PREMATURE_CLOSE'
}

Node.js v22.17.0
# after this is another "listening on" log; the container restarted
# server starts
Listening on port 8080
node:internal/process/promises:394
triggerUncaughtException(err, true /* fromPromise */);
^

Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
at onclose (node:internal/streams/end-of-stream:162:30)
at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {
code: 'ERR_STREAM_PREMATURE_CLOSE'
}

Node.js v22.17.0
# after this is another "listening on" log; the container restarted
Any request I throw at it to try to reproduce the issue works as expected, so I'm sure the machine's IP is not banned, and even OAuth callback requests work fine when I try them. But sometimes, for my users, they don't. What could be going on? Thanks
6 Replies
d.js toolkit
d.js toolkit5mo ago
shay
shayOP5mo ago
Not sure how to see the docker container version but I can provide that if I figure out how. i didn't clone the package, just pulled from https://hub.docker.com/r/discordjs/proxy
DD
DD5mo ago
that log is an I/O error are you sure you dont have any sort of network instability
shay
shayOP5mo ago
Not as far as I know It’s a hetzner server, I don’t manage the network
DD
DD5mo ago
its very hard to say without any idea what request causes it, if theres even a pattern best suggestion i can offer is look into the source code for the container and adjust it to log more things its pretty simple
shay
shayOP5mo ago
Well the only requests I run through it in prod are those related to oauth, so /callback and I think /users/@me Ok I’ll try that out

Did you find this page helpful?