## TL;DR
Treat the 500 as a server fault and retry with evidence: the Aim storage API returned an internal error on a sequence fetch, so capture the request and time, retry after a pause, and if it persists, report it as a server issue with the failing sequence identified. A 500 is the server admitting fault. The agent job is to prove it is not the request, preserve the details, and avoid hammering a struggling service.

```text
agent failed calling Aim storage API failed 500 internal error on sequence fetch
```

## Use this when
- The check or run fails with this symptom: an agent fails calling the Aim storage API with 500 internal error on sequence fetch.
- You are working on an agent workflow fetching metric sequences from a self-hosted Aim server and the failure repeats on the same data or configuration.
- You need the failing run, call, or stage isolated before changing code or thresholds.

## Not for this skill when
- A 500 triggered by one pathological sequence, such as an extremely long history, which needs that sequence isolated rather than a service ticket alone.
- The error text names a different tool, stage, or root cause. Match the verbatim error first and use that skill.

## Steps
1. Repeat the fetch for a different sequence on the same run. Verify: other sequences return, isolating the fault, or all fail, indicating a service wide problem
2. Check the Aim server health and its logs for the request time. Verify: a server side exception is recorded for the failing request
3. Retry the original fetch after a pause. Verify: the fetch succeeds, or the failure is consistent and reportable
4. If one sequence consistently fails, fetch its data in step ranges. Verify: the sequence is recovered in parts or the failing range is pinpointed
5. File the failure with the sequence identity, the request, and the server log reference. Verify: the report is actionable by whoever runs the server

## Variant phrasings
### agent failed aim storage api 500 sequence fetch
The shorter phrasing focused on the named failure.
### aim api internal error sequence agent error
The symptom phrasing a searcher tries next.
### aim storage 500 retry isolate fix
The variant naming the failing stage or tool directly.

Compatibility: Aim storage API, self-hosted Aim server operations, agent error handling

## Why it happens
Self-hosted tracking servers fail in ordinary operational ways: a storage backend hiccup, a memory limit on a huge sequence, or a version bug. Agent code that treats a 500 like a client error either loops forever or reports the run data as missing, when the data is fine and the service needs attention.

## Edge cases / pitfalls
- Backoff on 500s must be real: repeated instant retries can keep a struggling server down.
- Distinguish server faults from missing data in every summary, or teams will rerun good experiments.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_-lJ1sO2jfr2UMCqbcZlbUA
