Timeout (timeout)
Quick Fix & Resolution
If submitting a transaction, poll GET /transactions/{hash} or resubmit the exact same transaction envelope (same sequence number), or use a fee-bump transaction to increase the fee.
Response Payload & SDK Handling
json
{
"type": "https://orion.stellarchain.io/horizon-errors/timeout",
"title": "Timeout",
"status": 504,
"detail": "Your request timed out before completing. Please try your request again. If you are submitting a transaction make sure you are sending exactly the same transaction (with the same sequence number)."
}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/timeout') {
console.error('[timeout] HTTP 504:', 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 == 504 {
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
- Transaction submitted via
POST /transactionswas not included in a ledger within 3 consecutive ledger closes due to surge pricing. - A complex query exceeded the HTTP gateway timeout.