HTTP Server Error Status Codes (5xx)

Guide to 5xx server error responses: diagnosing 500, 502, 503, 504 errors, retry strategies, and monitoring.

  • JSON8,472 B
  • YAML6,313 B · −25%
  • TOON5,871 B · −31%

A guide to 5xx server-error codes (500, 501, 502, 503, 504, 507 and 511) with causes, diagnosis steps, what a client should do and what a server owner should fix, plus a retry strategy and monitoring metrics.

Use it when

  • You are diagnosing a 5xx response or deciding how clients should retry.
  • You are defining monitoring for server errors.

Watch out for

  • 5xx codes do not say whether a request had effects; retry only idempotent requests or use idempotency keys.
  • Retries without backoff and jitter can turn a partial outage into a full one.

The data

Server errors

CodeNameCauseDiagnosisClient actionServer fixExample
500Internal Server ErrorGeneric server-side error; unhandled exception, unexpected condition.Check application logs, stack traces, error monitoring (Sentry, Datadog). Common causes: null pointer, DB connection failure, unhandled promise rejection.Retry after delay (exponential backoff). If persists, contact support with request ID/timestamp.Add error handling, validate inputs, ensure resources available, catch exceptionsnull
501Not ImplementedServer does not support the functionality required to fulfill the request.Check API documentation; endpoint may be planned but not releasedUse alternative endpoint or method; check docs for supported operationsnullMethod not implemented (POST on endpoint that only supports GET), feature flag disabled
502Bad GatewayServer acting as gateway/proxy received invalid response from upstream server.Check upstream service health, connectivity, response format; inspect proxy logsRetry after short delay (upstream may be temporary); if persistent, contact API providernullNginx proxy to PHP-FPM got malformed response, API gateway to microservice got 404/invalid JSON
503Service UnavailableServer temporarily unable to handle request due to overload or maintenance.Check server load (CPU/memory), connection pool exhaustion, deployment statusRetry with exponential backoff (e.g., 1s, 2s, 4s, 8s); check status page for known outageScale resources, enable connection queuing, implement graceful degradation, schedule maintenance windowsToo many concurrent connections, server restarting, maintenance mode, auto-scaling cold start
504Gateway TimeoutGateway/proxy did not receive timely response from upstream server.Check upstream service latency, database query performance, network connectivity, timeout configurationsRetry with longer delay (upstream may need recovery); consider breaking request into smaller chunksnullNginx proxy timeout after 60s, API gateway upstream slow query (>30s), slow third-party API
507Insufficient StorageServer unable to store representation (disk full, quota exceeded).Check disk space (`df -h`), inode usage, storage quotas, cleanup old filesnullIncrease storage, implement cleanup policies, add monitoring alerts for disk spaceUpload fails because disk full, user storage quota exceeded, temp directory full
511Network Authentication RequiredClient needs to authenticate to gain network access (captive portal, proxy auth).Check if behind captive portal; client should redirect user to login pageOpen browser to authenticate; client libraries should handle 511 by showing login URLnullWi-Fi hotspot login page, corporate proxy requiring credentials

Retry strategy

Exponential backoff
Wait = min(2^n * base, max_delay) where n = attempt number (starting at 0)
Example config
Initial delay ms
1000
Max delay ms
60000
Multiplier
2
Max retries
5
Jitter
Add random ±10-25% to prevent thundering herd
Idempotency
Only retry idempotent methods (GET, PUT, DELETE, HEAD, OPTIONS); POST should be retried only with idempotency key

Monitoring metrics

  • Error rate percentage (5xx / total requests)
  • P99/P95 latency of error responses
  • Upstream service health checks
  • Server resource metrics (CPU, memory, disk, connections)
  • Circuit breaker state (open/closed/half-open)

Fields

The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.

SectionFieldTypeExample
server_errorscodeinteger500
server_errorsnamestringInternal Server Error
server_errorscausestringGeneric server-side error; unhandled exception,…
server_errorsdiagnosisstringCheck application logs, stack traces, error mon…
server_errorsclient_actionstringRetry after delay (exponential backoff). If per…
server_errorsserver_fixstringAdd error handling, validate inputs, ensure res…
server_errorsexamplestringMethod not implemented (POST on endpoint that o…
retry_strategy*object{exponential_backoff,example_config,jitter,idempotency}
monitoring_metrics*array[5 items]

Fetch the same bytes

The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.

curl "https://yjtoon.yunusemrevurgun.com/api/dataset/http-server-error-guide?format=toon"
const res = await fetch(
  "https://yjtoon.yunusemrevurgun.com/static-data/dataset/http-server-error-guide.toon"
);
const toon = await res.text();

Rate limit: 120 requests per minute per IP, no key and no signup. API reference →

Topics

  • http
  • server-errors
  • 5xx
  • monitoring
  • retry
  • devops

Search the library

Search by a topic, title, or keyword.

Start with a collection

Browse all 205 datasets