Skip to content
Latchkey

Elastic Beanstalk "Failed to deploy application" in CI

eb deploy uploaded the version and started rolling it out, but the deployment commands on the instances failed. Beanstalk reports "Failed to deploy application" and rolls back to the prior version.

What this error means

eb deploy ends with "ERROR: Failed to deploy application." and "Command failed on instance" or "Unsuccessful command execution on instance" in the environment events.

eb
ERROR: Failed to deploy application.
ERROR: Unsuccessful command execution on instance id(s) 'i-0abc123'.
Aborting the operation.

Common causes

An application or container command failed on the instance

A deploy hook, a dependency install, or the app start command exited non-zero on the instance, failing the platform deployment.

The app does not start or bind the expected port

The proxy health check fails because the application crashes on boot or listens on the wrong port, so the deploy is rolled back.

How to fix it

Pull the instance logs

  1. Request the bundle logs to see the failing command output.
  2. Read eb-engine.log and the application log for the real error.
  3. Fix the failing command or startup, then deploy again.
Terminal
eb logs --all

Verify the start command and port

Ensure the platform start command boots the app and it binds the port Beanstalk proxies (often via the PORT env var).

Procfile
# Procfile - app must listen on $PORT
web: gunicorn app:app --bind 0.0.0.0:$PORT

How to prevent it

  • Test deploy hooks and start commands on the target platform locally.
  • Bind the app to the Beanstalk-provided PORT.
  • Keep the platform version current so hooks behave predictably.

Related guides

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