App restarts at least once every time it's deployed [or rogue multiple instances of the app]

We’re not talking about occasional random restarts – we understand that can happen for any number of reasons on Render’s side. We’re seeing immediate, consistent restarts every time we deploy. We’re stumped on debugging this and believe it’s a problem on Render’s side.

Relevant facts:

  1. The instance is the Starter tier (not the free tier).
  2. The runtime is Node.
  3. There are no error messages in the logs.
  4. The server is responding to the health check:
  5. After the restart, the server continues running as normal.
  6. This seems to happen consistently with every deploy.
  7. Other behavior from the app implies it restarts a third time, but this does not appear in the logs.

You can see the restart in the log excerpts below.

Jul 31 12:51:45 PM  ==> Using Node version 16.20.1 via /opt/render/project/src/package.json
Jul 31 12:51:45 PM  ==> Docs on specifying a Node version:
Jul 31 12:51:45 PM  ==> Starting service with 'node app.js'
Jul 31 12:51:45 PM  [various app-specific output as expected]
Jul 31 12:51:45 PM  [app] is running; listening for events from the web
Jul 31 12:51:46 PM  DEBUG nonce: XTSU41jW7+4QbzSBYVd9xA==
Jul 31 12:52:42 PM  ==> Using Node version 16.20.1 via /opt/render/project/src/package.json
Jul 31 12:52:42 PM  ==> Docs on specifying a Node version:
Jul 31 12:52:42 PM  ==> Starting service with 'node app.js'
Jul 31 12:51:45 PM  [repeat of various app-specific output]
Jul 31 12:52:42 PM  [app] is running; listening for events from the web
Jul 31 12:52:44 PM  DEBUG nonce: iL9SKw+3uKSl/Y3h5hyK0A==

Any ideas what could be causing these restarts?

Do you have more than one instance running of this app? (Scaling section after clicking the application on the Dashboard). This sounds more like > 1 instance of the app rather than random restarts.

1 Like

Ah, good question; I should’ve included that in the list of “relevant facts”. But, no, that doesn’t seem to be the explanation:

PS: But you’ve now made us realize that that an additional rogue instance of the app could indeed explain this, even if not due to scaling settings. If so, does it sound possible that that could be Render’s fault somehow?

We’re now trying to debug this by creating lockfiles. But it seems like different instances of the app don’t share the same filesystem? Is that true?

That’s correct. Even when you have multiple instances of an app, each instance is an isolated container executing the app.

I think you should contact us directly, the best method is via the “Contact Support” link at the bottom of the Dashboard, so we can look into this at a lower level, and share more information about your app non-publicly.

1 Like

We’re now working on this in a support thread (thank you!) and I’m just giving a status update here for anyone, like our future selves, following along:

  1. We seem to have ruled out multiple instances. We believe our app is crashing or getting killed by Render and then restarting.
  2. We can’t replicate this outside of Render. We even tried in Docker container and it doesn’t crash locally but with the same Docker container on Render, it does crash.
  3. We tried deploying to Replit and it works like a charm there, convincing us even more that there’s a bug on Render’s side.
  4. It could still be something wrong we’re doing, of course, that Replit and our local dev environments somehow manage to be robust to, but in that case we believe the Render bug would be the lack of diagnostics like an exit code or something in the logs about our app crashing or getting killed.

Update: There are plenty of things worse about Replit’s hosting than Render’s so we do still care about getting this figured out. Also we’re just dying to learn the resolution of this mystery!

There may have been an email glitch on my end with the support thread so I wanted to ping @Jason-Render here before this thread auto-closes. Latest is that we’re still resorting to Replit hosting for this project.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.