Resource Limit Exceeded (resource_limit_exceeded)
Quick Fix & Resolution
Supply a narrower cursor range, lower the limit parameter, or use pre-aggregated /v3/statistics endpoints for network-wide analytics.
Response Payload & SDK Handling
json
{
"type": "https://orion.stellarchain.io/horizon-errors/resource_limit_exceeded",
"title": "Resource Limit Exceeded",
"status": 422,
"detail": "The request exceeded the configured resource or query work limit."
}typescript
import { Horizon } from '@stellar/stellar-sdk';
const server = new Horizon.Server('https://pubnet.stellarchain.io');
try {
const res = await server.ledgers().limit(10).call();
} catch (err: any) {
const problem = err?.response?.data;
if (problem?.type === 'https://orion.stellarchain.io/horizon-errors/resource_limit_exceeded') {
console.error('[resource_limit_exceeded] HTTP 422:', problem.detail, problem.extras);
}
}go
client := &horizonclient.Client{
HorizonURL: "https://pubnet.stellarchain.io",
}
_, err := client.Root()
if hErr := horizonclient.GetError(err); hErr != nil {
if hErr.Problem.Status == 422 {
log.Printf("Problem (%s): %s - extras=%v", hErr.Problem.Type, hErr.Problem.Detail, hErr.Problem.Extras)
}
}bash
curl -i -s "https://pubnet.stellarchain.io/" \
-H "Accept: application/hal+json"Common Root Causes
- Scanning an unbounded historical range without a selective filter or cursor.
- Querying an account with an extremely large subentry or participant fanout beyond the single-query work budget.