Read App Logs and Diagnose Failed Startup
Who this is for
Users whose app has failed to start, is crashing, or is behaving unexpectedly, and who need to read the container logs to diagnose the problem.
How to View App Logs
- Open the app detail.
- Click the Logs tab.
- The last 200 lines of container output are displayed by default.
- Use the Tail dropdown to change the number of lines (1–500).
For compose apps, logs from all services are shown together.
What the Logs Show
The logs tab shows container stdout and stderr output. This is equivalent to running:
docker logs --tail 200 <container-name>
For compose apps:
docker compose logs --tail 200
Common Log Patterns and What They Mean
App is running and healthy
Server listening on port 3000
Connected to database
Normal output. App is up.
Port binding failure
Error: listen EADDRINUSE: address already in use :::3000
The port the app is trying to listen on is already in use inside the container, or the host port is conflicting with another process. Check the port mapping configuration.
Missing environment variable
Error: DATABASE_URL is not defined
TypeError: Cannot read property 'host' of undefined
A required environment variable is missing. Check the Environment tab.
Database connection failure
Error connecting to database: connection refused
The database is not running, or the connection string is wrong. For compose apps, ensure the database service is healthy and the hostname matches the service name.
Out of memory
Killed
Container was killed by the OOM (out of memory) killer. Increase the memory limit in app settings.
Image pull failure (at deploy time, shown in Activity Center)
Unable to find image 'myimage:v2' locally
Error response from daemon: manifest for myimage:v2 not found
The image tag does not exist on the registry. Verify the image reference.
Exit Code Meanings
The logs response includes an exitCode field:
| Exit code | Meaning |
|---|---|
null | Container is still running |
0 | Container exited cleanly (intentional stop or job completion) |
1 | Generic error — check logs for details |
137 | Killed by OS (usually OOM — out of memory) |
139 | Segmentation fault |
143 | Terminated by SIGTERM (graceful shutdown) |
What to Do If App Keeps Crashing
- Read the last 200 lines of logs — look for the error before "exiting".
- Check environment variables are all set correctly.
- Verify the Docker image exists and is accessible.
- Try running the image with a shell to debug interactively:
- SSH into the server via the Terminal tab.
- Run:
docker run -it --rm/bin/sh
- Increase the memory limit if you suspect OOM.
- Set
restartPolicy: noto prevent the container from restarting while you debug.
What Success Looks Like
Logs show normal startup output without errors. App status is running. The healthcheck endpoint returns 200 OK.
Common Issues and Fixes
| Issue | Likely cause | Fix |
|---|---|---|
| "SERVER_NOT_READY" error | SSH is down | Check server SSH status. |
| Logs show no output | App outputs nothing to stdout | Some apps log to file only. SSH in and check /var/log/ or the app's log directory. |
| Compose logs mixed and hard to read | Multiple services | Filter by service name in the search. Or SSH in and run docker compose logs . |
Related Articles
- KB-04-02: Create a Container App
- KB-04-13: Healthcheck Behavior
- KB-04-08: Environment Variables
- KB-02-14: Server Terminal