Deployment Diagnosis
Use Devpilot's AI-powered deployment diagnosis to analyze failed deployments, identify the root cause, and follow suggested fixes.
Deployment Diagnosis
When a deployment fails, understanding the root cause can be time-consuming — especially when the error is buried in a long log or involves multiple interacting systems. Devpilot's deployment diagnosis feature uses AI to analyze your failed deployment, classify the failure, identify the affected step, and suggest specific fixes you can apply.
How deployment diagnosis works
When a deployment fails, Devpilot captures every hook's output and exit code. The diagnosis feature feeds that data — along with context about your application and platform — into an AI model. The model produces a structured diagnosis that Devpilot stores alongside the deployment, so anyone on your team who opens the failed deployment sees the same analysis.
Each diagnosis records:
- Category — The class of failure (see the list below).
- Severity — High or Critical, indicating how much it impacts deployment.
- Affected step — The hook where the failure originated (for example, "Install Dependencies", "Build Application", "Run Migrations", "Clone project from version control", or "Cache Views").
- Root cause — A plain-language explanation of what went wrong.
- Suggested fixes — One or more concrete actions you can take, ordered by likelihood of resolving the issue.
- AI model used and analysis duration — For transparency about which model produced the diagnosis and how long it took.
Diagnosis categories
Diagnoses fall into these categories, which Devpilot uses to route you to the right fix guidance:
| Category | What it means |
|---|---|
| Dependency failure | A package, binary, or runtime was missing or could not be installed. The most common category today — typical causes are a missing npm or composer binary, missing PHP extensions (for example ext-dom, ext-simplexml), or a missing framework CLI such as next. |
| Runtime error | The build or process ran but crashed — for example, a framework CLI exited with an uncaught error during build. |
| Git failure | Devpilot could not interact with your Git repository. Typical cause: the server has no SSH private key configured, or the key is not authorized on the Git provider. |
| Database connection | Migrations or other database work failed because the app could not reach the database. Typical causes are wrong credentials or the database server being unreachable. |
| Configuration error | An environment variable, config file, or server setting is missing or incorrect for the deployment to proceed. |
Using the Diagnose feature
Open the failed deployment
Open the deployment list for your application and click the deployment with a Failed status.
Run diagnosis
Click the Diagnose action on the deployment. Devpilot sends the deployment data to its AI analyzer. The first run typically takes several seconds; you can reopen the page later and the diagnosis is persisted.
Diagnosis only runs on Failed deployments. On Completed, Cancelled, Pending, or Processing deployments the Diagnose action is not available.
Review the diagnosis
The diagnosis panel shows:
- The category (for example, Dependency failure) and severity (High or Critical).
- The affected step — the hook where the failure originated.
- A root cause explanation in plain language.
- Suggested fixes, each with the specific action to take.
Apply a fix and redeploy
Apply the recommended fix. Depending on the category, this might mean:
- Installing a missing binary or PHP extension on the server (Dependency failure).
- Adding your server's SSH key to your Git provider (Git failure).
- Correcting an environment variable or database credential (Database connection / Configuration error).
- Updating application code and pushing a new commit (Runtime error).
After applying the fix, trigger a new deployment to verify the issue is resolved.
Re-run diagnosis if needed
If you make configuration changes and want to re-run diagnosis on the same deployment, use the Retry Diagnosis action. Devpilot rate-limits retries to five per minute per deployment to prevent runaway requests.
Recurring failure patterns
When the same failure signature appears across multiple deployments for an app, Devpilot records it as a failure pattern and tracks how often it has occurred. This helps you spot issues that are not one-offs — for example, a server that consistently lacks the right PHP extensions — and address them at the root rather than retrying deployments. The pattern history includes the list of affected deployments, the first and last times it occurred, a suggested permanent fix, and whether the pattern is resolved.
Examples of diagnoses Devpilot produces
These examples are representative of diagnoses Devpilot has surfaced on real deployments:
- Dependency failure on Install Dependencies (critical): "The 'npm' command is not installed or accessible in the deployment environment, preventing the installation of project dependencies."
- Dependency failure on Build Application (high): "The 'next' command required for building the application was not found, indicating that the Node.js runtime or required global dependencies are missing on the server."
- Dependency failure on Install Dependencies (critical): "Composer dependency installation failed because the required PHP extensions 'ext-simplexml' and 'ext-dom' are not installed on the server."
- Git failure on Clone project from version control (critical): "The deployment process failed because the SSH connection could not be initialized. This is due to the absence of a private key required for SSH key authentication."
- Dependency failure on Cache Views (high): "The PHP artisan command failed because the required
vendor/autoload.phpfile is missing, indicating thatcomposer installeither did not execute successfully or thevendordirectory was not properly created during the deployment."
Tips for effective troubleshooting
- Read the affected step first. The diagnosis tells you exactly which hook failed. Start there rather than scrolling through the entire log.
- Check the category. A Dependency failure almost always means something is missing on the server; a Git failure points to SSH or repo access; a Database connection failure points to credentials or network reachability.
- Fix the root cause, not the symptom. If a build fails because a binary is missing, install the binary; do not disable the hook.
- Use failure patterns. If the same failure has occurred several times, address it permanently rather than just retrying.
Next steps
Rollback and Recovery
Learn how to roll back to a previous deployment in Devpilot, understand what happens during a rollback, and follow best practices for recovering from deployment issues.
AI Assistance
Ask Devpilot's AI assistant questions about any deployment and get context-aware answers grounded in the deployment's hooks, logs, and errors.