> ## Documentation Index
> Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Failed to fetch full trace in data plane

export const plans_0 = "Plans: Enterprise"

export const deployments_0 = "Deployments: Self-hosted"

export const data_plane_version_0 = undefined

export const use_case_0 = "Use case - Self-hosted data plane deployments where opening large traces in the UI shows 'Failed to fetch' errors due to missing S3 CORS configuration"

<Note>
  **Applies to:**

  * Plan - {plans_0}
  * Deployment - {deployments_0}
  * {data_plane_version_0}
  * {use_case_0}
</Note>

## Summary

**Issue:** Opening a large trace in the UI returns a `Failed to fetch` error and the full raw trace does not load.

**Cause:** When a BTQL query result exceeds \~4MB, the API stores the result temporarily in the `bt-production-lambda-responses` S3 bucket and redirects the browser to fetch it via a presigned URL. This cross-origin redirect causes the browser to send `Origin: null`, which the S3 bucket's CORS policy does not allow.

**Resolution:** Update the CORS configuration on the `bt-production-lambda-responses` bucket to allow `*` as an origin.

***

## Resolution steps

### Diagnose the CORS issue

#### Step 1: Check the network request origin

Open your browser's Network tab, find the failing S3 GET request, and inspect the request headers.

If you see `Origin: null` (not `Origin: https://www.braintrust.dev`), the cross-origin redirect is causing the CORS block.

#### Step 2: Verify the bucket's CORS configuration

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
aws s3api get-bucket-cors --bucket <your-bt-production-lambda-responses-bucket>
```

If `https://www.braintrust.dev` is listed in `AllowedOrigins` but `null` is not, the existing config does not cover the redirect case.

***

### Fix the CORS configuration

#### Step 1: Update Terraform

Change `s3_additional_allowed_origins` to allow all origins:

```hcl theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
s3_additional_allowed_origins = ["*"]
```

#### Step 2: Apply the change

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
terraform apply
```

This updates the CORS policy on the `bt-production-lambda-responses` bucket to allow browser fetches from redirected presigned URLs.

***

## Additional context

* The `bt-production-lambda-responses` bucket holds ephemeral overflow files only — BTQL query result overflows and SDK log upload overflows. It does not store primary trace data.
* Every time a trace is opened in the UI, a fresh BTQL query runs and a new presigned URL is generated if the result exceeds \~4MB. Fixing CORS resolves the error for all traces, including previously affected ones.
