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] 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
- Open the App Runner application log stream (not the service event log).
- Find the startup stack trace or missing-variable error.
- Supply the missing config or fix the start command, then redeploy.
aws logs tail /aws/apprunner/<service>/<id>/application --since 20mSet 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.
run:
command: node server.js
env:
- name: NODE_ENV
value: productionHow 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.