In this categoryTroubleshooting ยท 27
- How to Fix an OpenAI 401 'Invalid API Key' ErrorStart
- How to Fix OpenAI 429 Rate Limit Errors With Backoff
- How to Fix Anthropic Claude API 401 Authentication Errors
- How to Fix Google Gemini 'API Key Not Valid' Errors
- How to Fix an API Key That Loads as Undefined
- How to Handle Anthropic 529 'Overloaded' Errors
- How to Fix Rate Limit Errors from an AI API
- How to Fix CORS Errors When Calling an AI API From the Browser
- How to Fix 'Model Not Found' and Deprecated Model Errors
- How to Rotate a Leaked API Key Without Downtime
- How to Fix SSL Certificate Errors When Calling AI APIs
- How to count tokens before sending a prompt to Claude
- How to Fix 'Context Length Exceeded' Token Limit Errors
- How to fix a context length exceeded error in the Claude API
- How to fix a Claude response that gets cut off mid-sentence
- How to reduce Claude hallucinations by grounding answers in your documents
- How to keep a long Claude conversation under the context limit
- How to stop Claude from calling tools when it should not
- How to handle a Claude Fable 5 refusal with a fallback model
- How to choose the right Claude model for cost and quality
- How to cut Claude API costs with prompt caching
- How to halve Claude costs for bulk jobs with the Batch API
- How to cap spend on a Claude agent with a task budget
- How to Debug an MCP Server That Will Not Connect
- How to Ask an Agent to Explain a Bug Before Fixing It
- How to Roll Back a Bad Deploy Quickly
- How to Fix Cursor Not Indexing Your Codebase
How to Roll Back a Bad Deploy Quickly
Get a broken release reverted in seconds by promoting the last good deploy instead of debugging in production.
When a deploy breaks production, the right first move is not to debug, it is to restore service by rolling back to the last good release. Most hosts keep previous deploys, so promoting one is faster than diagnosing the failure under pressure. This guide does that, then sets you up to investigate calmly.
What you need
- A host that keeps deploy history
- Access to the deploy CLI or dashboard
- About 6 minutes
Step 1: Confirm the deploy is the cause
Check that the break lines up with the latest release. If errors started at the exact deploy time, a rollback will fix it.
Step 2: Promote the last good deploy
Roll back by making the previous healthy deploy current again. This serves already-built files, so it takes effect almost immediately with no rebuild.
Step 3: Verify service is restored
Confirm the site is healthy again before you exhale. Watch the error rate fall back to normal and check the page directly.
curl -I https://my-site.example.app
# expect: HTTP/2 200, errors returning to baselineResult: service is back in seconds on a known-good build, and you can find the real cause without an outage running over your shoulder.
Watch related tutorials
15:50
1:42:18
28:14
41:09
9:47
8:23New guides in your inbox
Fresh step-by-step how-to guides as we publish them. One email a week, no more.