> For the complete documentation index, see [llms.txt](https://docs.infraglide.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infraglide.com/jane-ai-copilot/error-analysis.md).

# Deployment Error Analysis

When a Terraform Preview or Deploy fails, Jane AI can read the deployment logs and Terraform output and return a structured diagnosis: summary, root cause, suggested fix, severity, and affected resources.

***

## ⚡ How to Trigger Error Analysis

1. Go to **Deployments** (or open execution logs for a pipeline run).
2. Open a run with status **Failed** or **Partial Success**.
3. Click **Ask Jane** (label may show **Analysed** after a cached run).
4. Review the **Deployment analysis** card: summary, root cause, and suggested fix.

<figure><img src="/files/qlRHradRShXmQijUpSk5" alt="Jane AI Deployment Error Analysis"><figcaption><p>Figure 1: Jane AI Automated Deployment Error Diagnosis</p></figcaption></figure>

You can also ask Jane with a deployment context attached to trigger an analysis run.

### What Jane Reads

* `deploymentLogs` (truncated for the model)
* `terraformOutput` (truncated)

Output is intended for humans: it does not automatically mutate the pipeline. Secrets in logs should already be redacted by InfraGlide’s Terraform output redaction before persistence; still avoid pasting extra secrets into follow-up prompts.

***

### Applying the Fix

Jane’s **suggested fix** is advisory.

Typical loop:

1. Read the suggested fix.
2. Open the failing node(s) on the canvas and update configuration.
3. **Save** (or **Save as new version** if the pipeline is live).
4. **Preview**, then **Deploy** again.

Related but separate: **Generate remediation patch** (for security / drift / compliance findings) can produce canvas patches you explicitly **Apply to canvas**. That flow is not the same button as deployment analysis.

***

## 📋 What the Analysis Returns

* **Summary**: Short human-readable failure headline.
* **Root Cause**: Explanation of why Terraform failed (e.g. missing IAM role, CIDR conflict, invalid instance size).
* **Suggested Fix**: Clear steps to resolve the error inside InfraGlide or cloud provider console.
* **Severity**: `CRITICAL`, `HIGH`, `MEDIUM`, or `LOW`.
* **Affected Resources**: List of resource addresses impacted by the failure.

***

## 🔒 Confidentiality & Safe Diagnostics

Jane analyzes error traces securely:

* Provider credentials are automatically stripped from log outputs before sending to the model.
* Internal database connection strings and raw environment variables are never included.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.infraglide.com/jane-ai-copilot/error-analysis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
