> ## Documentation Index
> Fetch the complete documentation index at: https://a5eb32f-docs-2.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://a5eb32f-docs-2.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://a5eb32f-docs-2.manicule.dev/api/mcp.
> Every agent surface: https://a5eb32f-docs-2.manicule.dev/.well-known/llms-manifest.json

# Diagnose Builds and Roll Back Releases (/deployments/build-logs-and-rollbacks)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 665 · updated: 2026-11-25 -->
Related: [Choose a Cloud and Deploy Your App](/deployments/multi-cloud.md), [Host Your App on BhaiCode Global Edge](/deployments/bhaicode-edge.md), [Point a Custom Domain at Your App](/deployments/custom-domains.md), [Troubleshooting](/deployments/troubleshooting.md)

> Follow build logs to find a deployment failure or redeploy a known-good release from history.

Use build logs to find out why a deployment didn't finish, and use release history when a deployed version introduces a regression. BhaiCode records deployments by version, so you can distinguish a failed build from a bad release that reached users. A rollback needs an earlier release with a build or artifact BhaiCode can redeploy.

## Find the first build error

Open the deployment in Cloud Studio and check its status and error message. Follow the live build log when available. BhaiCode's build engine streams output with server-sent events (SSE), so you can see stages such as dependency installation, compilation, and asset distribution as they run. On a provider-managed deployment, use the provider's deployment logs for details about that build.

Start with the first error that stops the build. Later lines often report the consequences of that failure. If the log names a missing environment variable, check the selected project and deployment environment without copying the secret value into a ticket or chat. If it points to a TypeScript error, inspect the file and line, correct the source, and run the failing check before redeploying.

## Redeploy a known-good release

<Steps>
<Step title="Find the last release you trust">Open the **Deployment** drawer and look at **Previous releases**. Check the hosting target, release time, and status so you don't select an unrelated deployment.</Step>

<Step title="Start the rollback">Select **Rollback** on the live release you want to restore. BhaiCode creates a new deployment from the saved artifact or build reference and keeps the original history entry.</Step>

<Step title="Verify the restored app">Wait for the new deployment to report that it's live, then open the live URL and retry the action that exposed the regression. If the rollback fails, check its error before starting another release.</Step>
</Steps>

<Warning>Rolling back a deployment restores application code. It doesn't undo database migrations or restore database contents. Check that the older release still works with the current schema before you send users back to it.</Warning>

After users are back on a working release, use the original failure details to prepare and test the forward fix.

Keep the failed and restored release entries distinct when you hand off the incident. The first shows what went wrong; the second tells the next person exactly what is serving users.

## Next

* [Choose where to publish a new release](/deployments/multi-cloud)
* [Plan a database migration separately](/databases/migrations)
