App Platform - Weird restarts + 504 Error

Hi community and thank your for your time.

I’m using App Platform since 3 months (come from Heroku) and i have two strange behaviors :

  • First , sometimes my Node.JS app reboot automatically for no reasons. I can see the “restart count” insights which increases 7/8 times a day. I’m using winston and Logtail to track errors in my app but there is no log before the “Server listening…” line. Also, the RAM and CPU are fine. How can i know why my app is restarting ?

image alt text

  • Secondly, sometimes, i have the following error during requests between two services (APIs) :
      <!DOCTYPE html>
          <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
          <meta name=\"robots\" content=\"noindex\">
          <style>body,html{height:100%;margin:0}body{display:flex;align-items:center;justify-content:center;flex-direction:column;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}p{text-align:center;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;color:#000;font-size:14px;margin-top:-50px}p.code{font-size:24px;font-weight:500;border-bottom:1px solid #e0e1e2;padding:0 20px 15px}p.text{margin:0}a,a:visited{color:#aaa}</style>
      <p class=\"code\">
      <p class=\"text\">
        We encountered an error when trying to load your application and your page could not be served. Check the logs for your application in the App Platform dashboard.
        <div style=\"display:none;\">
    upstream_reset_before_response_started{connection_termination} (503 UC)      </h1>
          <p data-translate=\"connection_timed_out\">App Platform failed to forward this request to the application.</p>

It’s critical becauses it breaks somes requests. I have no logs for that too.

Thank you for your help.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
May 6, 2023

Hi there,

I’m sorry to hear that you’re experiencing issues with your Node.js app on DigitalOcean’s App Platform.

The unexpected restarts, sound like they could either happen during a deployment of a new version of your app, or your health checks might fail. Basically, the App Platform uses health checks to monitor the health of your app. If your app fails to pass these health checks, the platform may restart it. Review your app’s health check settings and ensure that they are properly configured. If your app takes some time to start, consider increasing the health check timeout value.

The above could be valid for both of the issues that you are seeing.

Regarding your resource limits, what you could do is consider increasing the resources allocated to the app temporarily and monitor the performance with the extra resources and see if the restarts and the 504 errors persist.

Another thing that you could consider is, if your app is using a database, you might want to check the resource utilization there as well to narrow down the issue.

Let me know how it goes!



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel