NEW
Also known as: 500 Internal Server Error
A server error indicating the server encountered an unexpected condition preventing it from fulfilling the request.
DESCRIPTION
HTTP 500 Internal Server Error signals that the server failed to process a request due to an unexpected condition. It is a generic error for unhandled exceptions or misconfigurations. Prefer more specific 5xx codes when applicable (e.g., 502, 503, 504). Good practices include structured error logging, correlation IDs, and returning problem details without exposing internals. Use circuit breakers and retries cautiously to avoid cascading failures. Monitoring rates of 500s helps track SLOs and incident impact. Graceful degradation and feature flags can limit user impact. Root cause analysis and automated testing reduce recurrence.
ALTERNATIVE DEFINITIONS
MDN Web Docs
The HyperText Transfer Protocol (HTTP) 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
Defines 500 as a generic server-side failure due to unexpected conditions.
IETF RFC
The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
Authoritative, normative definition for the status code.
RELATED TERMS
HTTP 502 Bad Gateway Circuit Breaker Retry Policy Observability Error Budget Logging Health Check Chaos Engineering Exception Handling
COMPETING TERMS
HTTP 503 Service Unavailable
KNOWLEDGE AREAS
Software Engineering Observability & Telemetry Testing & Validation
TARGET AUDIENCE
Software Developer DevOps Engineer Cloud Architect MLOps Engineer
EXTERNAL SOURCES
- Wikipedia - List of HTTP status codes#5xx server errors
- MDN Web Docs - All HTTP status code definitions
- Google SRE - Guidance on handling server overload
TOP QUESTIONS
What typically causes HTTP 500 errors?
Unhandled exceptions, null pointer errors, misconfigurations, and dependency failures commonly trigger 500 responses. They reflect server-side issues, not client faults.
Category: Example
How should I handle retries for HTTP 500?
Use exponential backoff and jitter. Avoid infinite retries and consider circuit breakers to prevent overload cascades.
Category: Requirements
How can I reduce HTTP 500 rates?
Improve error handling, add input validation, run comprehensive tests, and monitor dependencies. Use feature flags to disable failing paths.
Category: Management
When is HTTP 503 better than HTTP 500?
Use 503 for temporary overload or maintenance so clients can retry later. 500 is for unexpected internal errors.
Category: Alternatives
What is the risk of exposing stack traces with HTTP 500?
Stack traces can leak sensitive system details. Log them securely server-side and return generic error messages to clients.
Category: Risk
How do SLIs and SLOs relate to HTTP 500?
Success rate is often measured via non-5xx responses. High 500 rates degrade SLOs and trigger alerts.
Category: Overview
What observability signals help debug HTTP 500?
Use logs, traces with correlation IDs, metrics for error counts, and dependency health checks to locate failing components.
Category: Management
Are HTTP 500 errors cacheable?
They are typically not cacheable and should not be cached unless explicitly configured, which is uncommon.
Category: Misunderstanding
Can feature flags help mitigate HTTP 500?
Yes, toggling problematic features can reduce errors while you roll out fixes, improving resiliency during incidents.
Category: Example