HTTP Error Codes

500 Internal Server Error

HTTP 500

The server encountered an unexpected condition that prevented it from fulfilling the request.

What It Means

A 500 error is a generic "something went wrong" response. The server hit an error it wasn't prepared to handle. It's the server's fault, not the client's.

Common Causes

  • Unhandled exceptions — Code threw an error that wasn't caught
  • Database connection failure — Can't connect to the database
  • Configuration errors — Missing environment variables, bad config files
  • Memory/resource limits — Server ran out of memory or hit resource limits
  • Permission issues — Server process can't access needed files
  • Bad deployment — New code has bugs, missing dependencies

How to Debug

  1. Check server logs — The actual error is usually in the logs
  2. Check recent deploys — Did this start after a deployment?
  3. Check dependencies — Is the database up? External APIs responding?
  4. Check resource usage — CPU, memory, disk space
  5. Try to reproduce — What specific request triggers it?

Common Log Locations

# Nginx
/var/log/nginx/error.log

# Apache
/var/log/apache2/error.log

# Node.js (PM2)
~/.pm2/logs/app-error.log

# Docker
docker logs container_name

Prevention

  • Implement proper error handling and logging
  • Use health check endpoints to detect issues early
  • Set up uptime monitoring to catch 500s immediately
  • Use staging environments before deploying to production
  • Implement circuit breakers for external dependencies

For Visitors

If you're seeing this error as a user, it's not your fault. Try:

  • Refreshing the page
  • Waiting a few minutes and trying again
  • Checking the service's status page
  • Contacting support if the issue persists

Catch 500 errors before users do

UptimeSignal monitors your endpoints and alerts you when they start returning errors.

Start monitoring free →

Other Error Codes