Question:
I keep getting ‘Bad Gateway’ errors on my repl deployments and I am not sure how to fix the issue.
I think the error is probably 7 but I would just like some confirmation that the failure mode is ‘Bad Gateway’.
Troubleshooting tips that do not apply
- No - the repl works in the ‘dev’ environment
- No - it works continuously in the ‘dev’ environment, so I don’t think it is thisl.
- No - there are no errors in the logs.
- No - build command passes and works.
- No - I do not currently use secrets, I just have a configuration file.
- Doubt this - it does not take long to load the initial page. And passes the initial health check?
- No - I am using a mongodb atlas database
Troubleshooting that might apply
3. I am not sure how to rule this out. It’s an express app and this is the code I use to run it.
// where process.env.PORT is 8000.
const port = process.env.PORT || 8080
app.listen(port, () => {
})
I am not sure how consequential port choice is but note that in the logs, it says ‘forwarding local port 8080 to external port 1104’. So I think it just forwards any port I select to the port replit uses.
- The specs I use for the deployment are Pro (0.25 vCPU / 1 GiB RAM). I don’t actually know how much RAM the app uses. Most of the time, my repl shows it being under 1 GiB but I have seen it creep over that in the dev environment.
Would this be the kind of think that causes a ‘Bad Gateway’ error?
- The .replit configuration file does not contain anything in the deployment section that seems unusual. Though I do not know what the ‘ignorePorts = false’ part means.