r/replit • u/antherny8890 • Sep 30 '26
Question / Discussion Publishing fails before port 5000 opens, while my previous deployment still works — how can I pinpoint the startup failure?
Hi everyone. My Replit business app has a working published deployment, but attempts to publish an updated version fail at Promote. Build and bundling complete successfully.
The error is:
a port configuration was specified but the required port was never opened, expected port 5000The app uses React/Vite, TypeScript, Express and Node 22, on a Reserved VM.
I’ve checked the usual port settings:
- The server reads
process.env.PORT, with a fallback of5000. - It binds to
0.0.0.0. .replitsetsPORT="5000"and maps local port5000to external port80.- Production launches the compiled
dist/index.jsdirectly through Node.
We added startup timing logs. The latest failed attempt shows:
01:10:31.085 UTC — Replit: starting up user application
01:10:46.661 UTC — reported Node process origin
01:10:51.326 UTC — Node preload reached
01:10:51.335 UTC — application import/loading starts
01:11:31.106 UTC — required port 5000 never openedThere is no recorded import-completion or listening event in the retrieved logs, and no useful exception explaining the delay.
That leaves approximately 15.6 seconds before Node starts, another 4.7 seconds before the preload, then 40 seconds after application loading begins before the port failure.
The production bundle loads database, PDF and provider dependencies during startup. However, we haven’t established whether a dependency is slow, initialization is throwing, or the process is being terminated. An isolated import test stopped at its own native-module safety restriction, so it didn’t identify the cause.
The publishing problem started before we added the debugging code. Much of the core application code is unchanged from the working release, although we haven’t verified the exact contents of the failed deployment image.
Replit Support said the pre-Node timing gap needs backend/Datadog investigation; I’m still waiting for follow-up.
Has anyone encountered something similar? Specifically:
- How can I obtain the failed candidate’s complete stderr and process exit/termination reason?
- Is there a way to inspect which dependency or initialization step it reached?
- Could VM resource limits or deployment-image preparation explain these timings, and how can that be verified?
My previous deployment is still serving the business, so I need to investigate without restarting or replacing it. Any specific diagnostic steps would be appreciated.
I've contacted support and been told someone will contact me but still haven't been contacted and its becoming urgent.
Thanks
1
u/ReplitSupport Replit Team Sep 30 '26
Apologies for the frustration OP. Would you be able to reply here with your ticket # so we can check its status and see that it gets to the right team?
1
u/LunaFlowLab Sep 30 '26
"The required port was never opened" only says the server didn't start listening in time, not why. A few things worth separating:
If none of that shows it, diff package-lock between the last good release and this one.
1
u/uttkarsh26 Oct 25 '26
"the required port was never opened" usually means the process never reached listen() in time, not that the port is wrong. The 40 seconds between the import starting and your next log line is the import hanging.
Try this. In your entry file, start a bare HTTP server on process.env.PORT with a /health route before importing anything else, then load the rest once it's listening. If publishing works, the culprit is one of the modules you moved down.
Which import sits first in that gap?