App Platform restarts, crash loops and failed deploys
An App Platform crash loop is a component that keeps restarting: its restart count climbs, the crash logs say why, and a failed deploy keeps the previous version live. Duskwatch is an independent iPhone app for DigitalOcean; it shows health and restarts per component, opens crash logs in one tap, and pushes when an app crash-loops.
Updated
- 3 in 15 minrestarts that make a crash loop, by default
- 10recent successful deploys you can roll back to
- 90 daysof build and deploy logs kept by DigitalOcean
- 1 pushper restart episode, replaced when it escalates
01Health
Start with the component, not the whole app
Restarts usually mean the process crashed, ran out of memory or failed its liveness check. Each component restarts on its own, so look at them one by one.
Restarting
Several restarts this hour, one of them recent.
Crash loop
Restarts again and again: 3 within 15 minutes by default, and you can pick 2 to 10.
Restarting or failing health checks
Every instance is up, yet checks fail: a warning after 10 minutes, never a page.
Unhealthy
Fewer instances ready than requested, or none: not serving in full.
Why the restart count points to a crash
From the DigitalOcean docs
In App Platform Insights, a rising restart count often indicates that the application has crashed or exited.
DigitalOcean docs: view App Platform insights (external link), verified
An app that runs out of memory may restart before its memory graph approaches 100%, so check the restart count as well.
DigitalOcean docs: troubleshoot apps in App Platform (external link), verified
02Logs
Find the cause in the crash logs
Runtime logs show what a component prints now. Crash logs keep the output from just before the last restart, which is usually where the error is.
| Log | What it holds | Where to read it |
|---|---|---|
| Build | Dependencies and compile errors | Activity tab, View details |
| Deploy | The rollout and its health checks | Activity tab, View details |
| Runtime | Live output of each component | Runtime Logs tab |
| Crash | Output before the last restart, with a likely reason | doctl apps logs --type=run_restarted |
In Duskwatch, an unhealthy component opens its crash logs first. How logs work.
From the DigitalOcean docs
Crash logs are not shown in the control panel; read them with doctl and the run_restarted type. Build and deploy logs are kept for 90 days, runtime logs only if you forward them.
DigitalOcean docs: view App Platform logs (external link), verified
03Deploys
A failed deploy leaves the previous version serving
App Platform keeps the running deployment until the new one is healthy. Read the failed step before you redeploy the same commit.
Build failed or deploy failed: where to look
- Build failed: the build log names the missing dependency or the compile error.
- Deploy failed: the new instances never passed their health check, so traffic stayed on the old ones.
From the DigitalOcean docs
App Platform keeps the previous instance of an app running until the new instance is considered healthy.
DigitalOcean docs: App Platform FAQ (external link), verified
04Fix
Roll back, restart one component, or redeploy
A rollback redeploys an earlier successful deployment and pins the app there until you decide. A restart reuses the running image.
- 1
Roll back
Pick an earlier deployment. Code, configuration and spec return; database data does not.
- 2
Watch it recover
New deploys, manual or on push, wait while the app is pinned.
- 3
Commit or revert
Commit keeps the older version and resumes deploys; revert returns to the spec from before.
In Duskwatch, each is a sheet you arm with a swipe, such as "Swipe to roll back api-prod", then Face ID.
Rollback limits, and what a restart does
From the DigitalOcean docs
You can roll back to one of the ten most recent successful deployments, in the same region and with the same databases; database data is not rolled back.
DigitalOcean docs: manage App Platform deployments (external link), verified
A restart is a rolling restart of the existing image, for every service and worker or only the components you select; jobs are not restarted.
DigitalOcean docs: restart or rebuild an app (external link), verified
05Alerts
One push for a crash loop, not a stream of them
App Platform can email you when the restart count passes a threshold. Duskwatch treats a run of restarts as one alert that escalates once.
- Restarting and crash loop are one episode: the escalation replaces the first notification instead of adding one.
- The episode stays open while a component has 3 or more restarts in the hour, the newest under 30 minutes old.
- Warnings end quietly; a recovery push follows only an alert that paged.
What App Platform itself can alert on
From the DigitalOcean docs
App Platform alerts cover deployment and domain events and CPU, RAM and restart count thresholds, sent by email or Slack. New apps get email alerts for failed deployments and domains.
DigitalOcean docs: App Platform alerts (external link), verified
What Duskwatch doesn't do here
- No editing the app spec or environment variables
- No alerts on log lines, and no log storage
- No creating, scaling or deleting apps
Questions
Why does my App Platform app keep restarting?
Usually the process exits: a crash, running out of memory, or a failing liveness check. The restart count shows how often, and the crash logs show the output from before each restart.
How do I see App Platform crash logs?
With doctl apps logs and the run_restarted type, since the control panel does not show them. In Duskwatch, they open from the component screen.
Does a failed deploy take my app down?
No. App Platform keeps the previous deployment serving until a new one is healthy, and the push says "The previous version is still live."
Can I roll back from my phone?
Yes. In Duskwatch, "Swipe to roll back api-prod" and Face ID start it, and a finding stays on the app until you commit or revert the rollback.
Will a restarting app flood me with pushes?
No. A run of restarts is one alert that escalates once if it becomes a crash loop, and a warning ends without a recovery push.