> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.islo.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.islo.dev/_mcp/server.

# Get line run failure diagnostics

GET https://api.islo.dev/factory/line-runs/{run_id}/debug

Per-stage and per-step diagnostics for one line run, including the last failed stage attempt's first failing step, each step's exit code and output tails, and the sandbox environment each stage ran in.

Reference: https://docs.islo.dev/api-reference/factory/get-factory-line-run-debug

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `run_id` (string, required)

## Response

### 200

Successful Response

- `id` (string, required)
- `line_name` (string, required)
- `status` (string, required)
- `triggered_by` (string, required)
- `line_version_id` (string, optional, nullable)
- `region` (string, optional, nullable)
- `started_at` (datetime, optional, nullable)
- `completed_at` (datetime, optional, nullable)
- `error_message` (string, optional, nullable)
- `failure_summary` (LineRunFailureSummary, optional, nullable) — The first failed step within the run's last failed stage attempt.
- `stages` (list of LineRunDebugStage, optional)

## Errors

### 404 Not Found Error

Not Found

- `code` (enum, required)
  - Allowed values: `AUTH_REQUIRED`, `INVALID_REQUEST`, `NOT_FOUND`, `VALIDATION_ERROR`, `SANDBOX_NOT_FOUND`, `SANDBOX_ALREADY_EXISTS`, `SANDBOX_INVALID_STATE`, `SANDBOX_PROVISIONING_FAILED`, `RESOURCE_NOT_FOUND`, `FILE_NOT_FOUND`, `COMMAND_NOT_FOUND`, `EXEC_FAILED`, `FILE_OPERATION_ERROR`, `RESOURCE_UNAVAILABLE`, `ACCESS_DENIED`, `CACHE_CONFLICT`, `BILLING_NOT_ALLOWED`, `TENANT_SUSPENDED`, `RATE_LIMITED`, `TIMEOUT`, `GONE`, `BAD_GATEWAY`, `INTERNAL_ERROR`
- `message` (string, required)
- `available` (long, optional, nullable)
- `limit` (long, optional, nullable)
- `request_id` (string, optional, nullable)
- `requested` (long, optional, nullable)
- `resource` (string, optional, nullable) — Optional capacity fields populated for `InsufficientResources` errors so clients (including peer agents) can recover the typed payload across HTTP boundaries instead of collapsing it to an opaque message.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### LineRunFailureSummary

The first failed step within the run's last failed stage attempt.

- `stage_name` (string, optional, nullable)
- `step_name` (string, optional, nullable)
- `failure_class` (string, optional, nullable)
- `error_code` (string, optional, nullable)
- `error_message` (string, optional, nullable)
- `error_details` (map from string to any, optional, nullable)
- `compute_command_id` (string, optional, nullable)

### LineRunDebugStage

- `stage_name` (string, optional, nullable)
- `stage_order` (integer, optional, nullable)
- `iteration` (integer, optional, nullable)
- `status` (string, optional, nullable)
- `outcome` (string, optional, nullable)
- `reason` (string, optional, nullable)
- `job_run_id` (string, optional, nullable)
- `job_version_id` (string, optional, nullable)
- `steps` (list of LineRunDebugStep, optional)
- `environment` (LineRunDebugEnvironment, optional)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### LineRunDebugStep

- `name` (string, optional, nullable)
- `action` (string, optional, nullable)
- `status` (string, optional, nullable)
- `task_name` (string, optional, nullable)
- `exit_code` (integer, optional, nullable)
- `error_code` (string, optional, nullable)
- `failure_class` (string, optional, nullable)
- `error_message` (string, optional, nullable)
- `error_details` (map from string to any, optional, nullable)
- `compute_command_id` (string, optional, nullable)
- `sandbox_name` (string, optional, nullable)
- `agent_session_id` (string, optional, nullable)
- `stdout_tail` (string, optional, nullable)
- `stderr_tail` (string, optional, nullable)
- `started_at` (datetime, optional, nullable)
- `completed_at` (datetime, optional, nullable)

### LineRunDebugEnvironment

- `sandbox_name` (string, optional, nullable)
- `region` (string, optional, nullable)
- `snapshot_name` (string, optional, nullable)
- `gateway_profile` (string, optional, nullable)

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "id": "string",
  "line_name": "string",
  "status": "string",
  "triggered_by": "string",
  "line_version_id": "string",
  "region": "string",
  "started_at": "2024-01-15T09:30:00Z",
  "completed_at": "2024-01-15T09:30:00Z",
  "error_message": "string",
  "failure_summary": {
    "stage_name": "string",
    "step_name": "string",
    "failure_class": "string",
    "error_code": "string",
    "error_message": "string",
    "error_details": {},
    "compute_command_id": "string"
  },
  "stages": [
    {
      "stage_name": "string",
      "stage_order": 1,
      "iteration": 1,
      "status": "string",
      "outcome": "string",
      "reason": "string",
      "job_run_id": "string",
      "job_version_id": "string",
      "steps": [
        {
          "name": "string",
          "action": "string",
          "status": "string",
          "task_name": "string",
          "exit_code": 1,
          "error_code": "string",
          "failure_class": "string",
          "error_message": "string",
          "error_details": {},
          "compute_command_id": "string",
          "sandbox_name": "string",
          "agent_session_id": "string",
          "stdout_tail": "string",
          "stderr_tail": "string",
          "started_at": "2024-01-15T09:30:00Z",
          "completed_at": "2024-01-15T09:30:00Z"
        }
      ],
      "environment": {
        "sandbox_name": "string",
        "region": "string",
        "snapshot_name": "string",
        "gateway_profile": "string"
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.islo.dev/factory/line-runs/run_id/debug"

headers = {"Authorization": "Bearer <api_key>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.islo.dev/factory/line-runs/run_id/debug';
const options = {method: 'GET', headers: {Authorization: 'Bearer <api_key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.islo.dev/factory/line-runs/run_id/debug"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <api_key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.islo.dev/factory/line-runs/run_id/debug")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <api_key>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.islo.dev/factory/line-runs/run_id/debug")
  .header("Authorization", "Bearer <api_key>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.islo.dev/factory/line-runs/run_id/debug', [
  'headers' => [
    'Authorization' => 'Bearer <api_key>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.islo.dev/factory/line-runs/run_id/debug");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <api_key>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <api_key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.islo.dev/factory/line-runs/run_id/debug")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```