Skip to content

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

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.

App Platform log types, what they hold and where to read them
LogWhat it holdsWhere to read it
BuildDependencies and compile errorsActivity tab, View details
DeployThe rollout and its health checksActivity tab, View details
RuntimeLive output of each componentRuntime Logs tab
CrashOutput before the last restart, with a likely reasondoctl apps logs --type=run_restarted

In Duskwatch, an unhealthy component opens its crash logs first. How logs work.

From the DigitalOcean docs

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.

The push for a failed deploy, with synthetic names
  • Time sensitive

    api-prod: deploy failed

    acme-prod

    The previous version is still live.

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

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. 1

    Roll back

    Pick an earlier deployment. Code, configuration and spec return; database data does not.

  2. 2

    Watch it recover

    New deploys, manual or on push, wait while the app is pinned.

  3. 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

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.
One restart episode as it escalates, with synthetic names
  • api-prod restarted several times

    acme-prod

    Restarted 4 times in the last hour.

  • Time sensitive

    api-prod keeps restarting

    acme-prod

    Restarted 4 times in 15 minutes.

What App Platform itself can alert on

From the DigitalOcean docs

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.

Duskwatch is on the App Store, for iPhone.

Download on the App Store

Basic monitoring is free; alerts, most actions and advanced features are part of Duskwatch Pro. See plans and prices