Skip to content
Latchkey

App Runner "service rolled back" container could not start in CI

App Runner launched the new revision but the application process exited (or crash-looped) before it could serve traffic. App Runner rolls back to the last running configuration and marks the deployment failed.

What this error means

The deployment status is FAILED with events like "Application could not start" or the application log shows the process exiting immediately after launch, then a rollback.

apprunner
[AppRunner] Your application could not start. Check the application logs.
[AppRunner] Deployment failed. Rolling back to previous running configuration.

Common causes

A missing runtime config crashes the app on boot

An unset environment variable, a bad start command, or a missing secret makes the process throw at startup before it can bind the port.

The wrong start command or entrypoint

The service start command points at a module or binary that does not exist in the image, so the container exits non-zero immediately.

How to fix it

Read the application logs

  1. Open the App Runner application log stream (not the service event log).
  2. Find the startup stack trace or missing-variable error.
  3. Supply the missing config or fix the start command, then redeploy.
Terminal
aws logs tail /aws/apprunner/<service>/<id>/application --since 20m

Set the correct start command and env

Define the start command and required runtime environment in the service or apprunner.yaml so the process boots cleanly.

apprunner.yaml
run:
  command: node server.js
  env:
    - name: NODE_ENV
      value: production

How to prevent it

  • Boot the image locally with the same env before deploying.
  • Provide every required environment variable and secret in the config.
  • Keep the start command in sync with the image entrypoint.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →