Historical DB Is Too Stale (stale_history)
Quick Fix & Resolution
Check GET / (history_latest_ledger vs core_latest_ledger) and retry.
Response Payload & SDK Handling
json
{
"type": "https://orion.stellarchain.io/horizon-errors/stale_history",
"title": "Historical DB Is Too Stale",
"status": 503,
"detail": "This horizon instance is configured to reject client requests when it can determine that the history database is lagging too far behind the connected instance of Stellar-Core or read replica."
}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/stale_history') {
console.error('[stale_history] HTTP 503:', 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 == 503 {
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
- Archive snapshot or live ingestion pipeline fell behind the network tip.