Debug a Failed Deployment
To debug a failed deployment, open your project's Deployments page, click the failed deployment, find the first job with status Failure (usually Build Container Image or Deploy Container) and read its log. Most failures come from the app listening on the wrong port or on 127.0.0.1, a missing environment variable, or running out of memory. Fix the cause, then push a fix or redeploy.
Temps records the exact step that broke and keeps its logs. If the app deployed but crashes or errors at runtime, check the runtime logs instead, and see Troubleshooting for problems with the server itself.
Check the deployment status
- Open your project in the dashboard
- Click Deployments in the sidebar
- The failed deployment will show a red
failedbadge
Click on the deployment to see its detail page. The deployment goes through several states (described in full under Deployment states):
| State | Meaning |
|---|---|
pending | Deployment is queued, waiting for a worker |
running | Build or deploy step is actively executing |
built | Defined in the state model, but not written by the v0.1.0-beta.57 pipeline |
completed | Fully deployed and serving traffic |
failed | Something went wrong — check the logs |
cancelled | Manually cancelled by a user before completion |
paused | Manually paused; can be resumed |
deployed | Resumed from paused, or the state a rollback restores |
stopped | Containers and resources were torn down, including when a newer successful deployment supersedes this one |
Read the build logs
The deployment detail page shows logs from every step. Look for the step marked with a red failure indicator.
Each deployment is broken into jobs that execute in order:
- Download Repository — Clones the Git repository
- Build Container Image — Builds the Docker image (from your Dockerfile or one generated from the framework preset)
- Deploy Container — Starts the container and waits for health checks
- Mark Deployment Complete — Switches traffic to the new deployment and updates the status
Additional jobs may include:
- Pull External Image — For deployments from a registry
- Verify Local Image — For uploaded images (checks the image exists)
- Configure Cron Jobs — Sets up scheduled tasks
- Configure Metric Alerts and Configure Agents — Apply settings from the repository
- Take Screenshot — Captures a preview of the deployed site (only if screenshots are enabled)
- Scan Vulnerabilities — Runs security scan (only if enabled on the project)
- Capture Source Maps — Uploads source maps for error tracking
Click on any job to expand its logs. The logs include timestamps and are searchable.
Stream logs in real-time
During a deployment, you can watch logs stream live via the dashboard. The logs update in real-time using WebSocket connections.
Access logs from the CLI or API
With the Temps CLI, bunx @temps-sdk/cli deployments logs -p my-app prints the latest deployment's build logs (add -d <deployment-id> for a specific one, or -f to follow).
# Get all jobs and their statuses
curl "https://your-temps-instance/api/projects/{project_id}/deployments/{deployment_id}/jobs" \
-H "Authorization: Bearer YOUR_TOKEN"
# Get logs for a specific job
curl "https://your-temps-instance/api/projects/{project_id}/deployments/{deployment_id}/jobs/{job_id}/logs" \
-H "Authorization: Bearer YOUR_TOKEN"
Check individual job statuses
Each job has its own status: Pending, Waiting, Running, Success, Failure, Cancelled, or Skipped. The first job with a Failure status is where you should focus.
Jobs also include:
- Error message — A summary of what went wrong
- Log ID — Identifier of the job's structured log (
log_idin the API) - Execution order — Where in the pipeline this job runs
- Dependencies — Which jobs had to complete before this one could start
If a required job fails, the workflow stops and all pending jobs are cancelled. Optional post-deploy jobs can fail without failing the deployment.
View container logs
If the deployment succeeded but your application crashes at runtime, check the container logs:
- Go to your project's Logs section in the sidebar
- Select the environment and container
- View the application's stdout/stderr output
From a terminal, bunx @temps-sdk/cli runtime-logs -p my-app -f streams the same output. See Logs for search and retention.
You can also stream container logs via WebSocket:
# WebSocket endpoint for live container logs
wss://your-temps-instance/api/projects/{project_id}/environments/{env_id}/containers/{container_id}/logs?follow=true×tamps=true&tail=100
Parameters:
follow=true— Stream new logs as they arrivetimestamps=true— Include timestamps on each linetail=100— Start with the last 100 linesstart_date/end_date— Filter by time range
Common failures and fixes
- Name
Build fails: 'npm install' or dependency errors- Description
Cause: Missing or incompatible dependencies, wrong Node.js version, or corrupt lockfile.
Fix: Check that
package-lock.json(oryarn.lock,pnpm-lock.yaml) is committed. Verify the Node.js version inpackage.jsonengines field or.node-versionmatches what your project needs. Trynpm cilocally to reproduce.
- Name
Build fails: 'Invalid Dockerfile'- Description
Cause: The Dockerfile is missing or could not be parsed.
Fix: Add a
Dockerfile, check the Dockerfile path in the project's build settings, or change the framework preset to the correct one (e.g. Next.js, Vite). Temps auto-detects frameworks — if the detection is wrong, override it.
- Name
Deploy fails: 'Health check failed'- Description
Cause: The container started but did not respond to HTTP requests in time. Before switching traffic, Temps requests
/(orhealth.pathfrom.temps.yaml) every 2 to 5 seconds and needs 2 consecutive successes. Connection errors and error responses are retried until the startup timeout (300 seconds by default; configurable from 30 to 3600 seconds from v0.1.0-beta.57), then the deploy fails. In v0.1.0-beta.56 and earlier the timeout was fixed at 300 seconds, and 60 seconds of error responses (4xxother than404/405, or5xx) in a row failed the deploy sooner withserver returned error status codes for 60 seconds. Either way the previous deployment keeps serving traffic. See How health checks work.Fix:
- Ensure your application listens on the port Temps routes to: the port set on the environment or project, the image's
EXPOSE, or3000by default (port resolution gives the order for your version). Read it fromPORTwith a fallback if the app may run on a release older than v0.1.0-beta.57, where a rollback does not setPORT - Ensure it binds to
0.0.0.0, notlocalhostor127.0.0.1 - Check container logs for startup errors
- If your app takes a long time to start, the health check may time out — raise Startup timeout (seconds) under Settings → Build & deploy, optimize startup time, or check resource allocation
- Ensure your application listens on the port Temps routes to: the port set on the environment or project, the image's
- Name
Deploy fails: 'Port already in use'- Description
Cause: A host port the deployment needs is already taken, most often a fixed host port in a Compose file.
Fix: For Compose, remove fixed host ports (publish only container ports, or bind to
127.0.0.1with an unused port). Otherwise stop the process holding the port;docker pson your server shows orphaned containers. To remove a stuck deployment, runbunx @temps-sdk/cli deployments teardown -p <project-id> -d <deployment-id>.
- Name
Deploy fails: 'Out of memory' or OOM kill- Description
Cause: The container exceeded its memory limit during build or startup.
Fix: Increase the memory limit in environment settings (see Scaling). For build-time OOM, your build process needs more memory — consider pre-building in CI instead.
- Name
Deploy fails: 'Built image missing'- Description
Cause: The Docker image from the target deployment is no longer on the server (for example, it was pruned).
Fix: Redeploy from source instead of rolling back. The image is rebuilt from Git.
Redeploy
After fixing the issue (updating code, fixing configuration, adjusting resources):
Option 1: Push a fix
git add .
git commit -m "fix: resolve build error"
git push
Temps automatically picks up the push and starts a new deployment.
Option 2: Redeploy the same commit
If you fixed the issue through configuration (environment variables, resource limits) rather than code:
- Go to the Deployments page
- Click Redeploy on the latest deployment (or use the trigger-pipeline API)
Option 3: Roll back
If the previous version was working, roll back to it while you investigate. A failed deployment never replaces the one that is serving traffic, but Temps does not roll back automatically after a deployment has succeeded: if a release goes live and then misbehaves, redeploy a previous deployment yourself (bunx @temps-sdk/cli deployments rollback -p my-app).
Option 4: Cancel a stuck deployment
If a deployment is stuck in pending or running:
curl -X POST "https://your-temps-instance/api/projects/{project_id}/deployments/{deployment_id}/cancel" \
-H "Authorization: Bearer YOUR_TOKEN"
This stops the build, writes a cancellation message to the logs, and marks the deployment as cancelled.