For the complete documentation index, see llms.txt.

Documentation

Repository docs

This route renders the repository README and markdown under docs/ .

Source: docs/STARTUP_AND_RUNTIME_FAILURES.md

Rendered document

docs/STARTUP_AND_RUNTIME_FAILURES.md

Parsed server-side (markdown to HTML in the app). Same bytes you get from the checkout.

Startup and Runtime Failures

These issues appear when the build succeeded but the app does not stay healthy — verify fails, ECS tasks exit, or the URL returns 502/503.

Symptom map

SymptomLikely stage
Verify step failsApp not responding on probed paths within timeout
Deploy running then degradedCrashes after initial success
ALB 502/503No healthy targets — wrong port or crashing process
ECS tasks stop repeatedlyExit on boot — missing env, DB connection, wrong CMD

Failure code for verify: DEPLOYMENT_VERIFICATION_FAILED

Port binding

ECS expects your container to listen on the port from the scan/Railpack plan (commonly 3000 for Node, 8000 for Python).

CheckAction
App binds localhost onlyBind 0.0.0.0
Hardcoded portUse process.env.PORT or plan port
Railpack start commandMust start the server, not just build

Example:

const port = process.env.PORT || 3000;
app.listen(port, '0.0.0.0');

Missing runtime environment

Container starts then exits — check ECS CloudWatch logs for:

  • DATABASE_URL undefined
  • connection refused to Postgres/Redis
  • missing API keys

Set vars in Smart Deploy runtime env and redeploy.

See Environment Variables.

Wrong start command

Railpack deploy.startCommand must match how your app runs in production:

MistakeFix
npm run dev in productionUse npm run start or node dist/index.js
Migrating DB on every boot without DBAdd migrations or fix DATABASE_URL
SPA static server on wrong pathPoint serve command at dist or build output

Override in scan results or fix repo scripts.

Slow cold start

Verification waits up to ~5 minutes. If your app needs longer:

  • Optimize startup (lazy init, smaller image)
  • Add /health that returns 200 only when ready
  • Reduce dependencies loaded at boot

See Health Checks.

ECS diagnostics on verify failure

Failed verify appends to logs:

  • ECS service events (task failed to start, unhealthy target)
  • Filtered CloudWatch high-signal lines

Read these before re-running deploy blindly.

Static sites

Runtime failures are rare — usually wrong S3 content or missing index.html:

  • 404 on all routes → build output path wrong
  • Blank page → JS bundle path wrong for asset prefix

Check RAILPACK_SPA_OUTPUT_DIR and build logs.

Debugging workflow

  1. Deployment History → Verify step logs
  2. Logs tab → CloudWatch runtime tail
  3. Deployment Agent → runtime health (HTTP status, ECS counts)
  4. Compare env vars to local .env that works
  5. Rollback if outage is severe — History and Rollback

Related