client closing connection
cyberfights
HOBBYOP

3 months ago

"2025-11-30T19:24:23.020816744Z"

"POST"

499

"HTTP/1.1"

"HTTP/1.1"

"client has closed the request before the server could send a response"

"europe-west4-drams3a"

"[{"deploymentInstanceID":"duration":4788,"error":"client has closed the request before the server could send a response"}]"

any build other than the nixpack results in this error, the nix is deprecated is there a fix?

Solved$10 Bounty

Pinned Solution

bytekeim
PRO

3 months ago

fix it like this exact copy-paste:

const port = process.env.PORT || 8080;

app.listen(port, "0.0.0.0", () => {
  console.log(`Wrestling bot API running on port ${port}`);
});

let me knew the result

13 Replies

Railway
BOT

3 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


bytekeim
PRO

3 months ago

hey, can you paste the exact start command that shows up in the deploy logs when it successfully deploys with Nixpacks?


bytekeim

hey, can you paste the exact start command that shows up in the deploy logs when it successfully deploys with Nixpacks?

cyberfights
HOBBYOP

3 months ago

Starting Container

> wrestling-roleplay-bot@1.0.0 start

> node wrestling.js

Wrestling bot API running on port 8080

npm warn config production Use --omit=dev instead.


bytekeim
PRO

3 months ago

your app hardcodes port 8080; that's why it only works on nixpacks (legacy port detection) and 499s on Railpack/Dockerfile

open wrestling.js and change the .listen line to:

const port = process.env.PORT || 8080;

app.listen(port, "0.0.0.0", () => { console.logWrestling bot api running on port ${port}); });

push and redeploy , lmk if it works


bytekeim

your app hardcodes port 8080; that's why it only works on nixpacks (legacy port detection) and 499s on Railpack/Dockerfileopen wrestling.js and change the .listen line to:const port = process.env.PORT || 8080;app.listen(port, "0.0.0.0", () => { console.logWrestling bot api running on port ${port}); });push and redeploy , lmk if it works

cyberfights
HOBBYOP

3 months ago

const PORT = process.env.PORT || 8000;

app.listen(PORT, () => console.logWrestling bot API running on port ${PORT}));

is what it is right now


bytekeim

your app hardcodes port 8080; that's why it only works on nixpacks (legacy port detection) and 499s on Railpack/Dockerfileopen wrestling.js and change the .listen line to:const port = process.env.PORT || 8080;app.listen(port, "0.0.0.0", () => { console.logWrestling bot api running on port ${port}); });push and redeploy , lmk if it works

cyberfights
HOBBYOP

3 months ago

changed to this, same error on railway deployment build


bytekeim
PRO

3 months ago

fix it like this exact copy-paste:

const port = process.env.PORT || 8080;

app.listen(port, "0.0.0.0", () => {
  console.log(`Wrestling bot API running on port ${port}`);
});

let me knew the result


bytekeim

fix it like this exact copy-paste:const port = process.env.PORT || 8080; app.listen(port, "0.0.0.0", () => { console.log(`Wrestling bot API running on port ${port}`); });let me knew the result

cyberfights
HOBBYOP

3 months ago

tysvm!!! its not erroring now on post thank u!!!


bytekeim

fix it like this exact copy-paste:const port = process.env.PORT || 8080; app.listen(port, "0.0.0.0", () => { console.log(`Wrestling bot API running on port ${port}`); });let me knew the result

cyberfights
HOBBYOP

3 months ago

solution accepted


bytekeim
PRO

3 months ago

awesome! glad it’s working now, If you hit any other issues just lmk


bytekeim

awesome! glad it’s working now, If you hit any other issues just lmk

cyberfights
HOBBYOP

3 months ago

thank u will do


Status changed to Solved brody 3 months ago


bytekeim

awesome! glad it’s working now, If you hit any other issues just lmk

cyberfights
HOBBYOP

3 months ago

ok so its working but half the time its giving the error rest of the time working fine


Status changed to Awaiting Railway Response Railway 3 months ago


bytekeim
PRO

3 months ago

perfect, now i think the "half the time" 499 is 100% classic Hobby plan cold starts, pro plan removes sleeping completely if you prefer

good night @cyberfights


Status changed to Solved ray-chen 3 months ago


Loading...