ERPNext: Resolving Internal Server Errors (HTTP 500) on ERPNext production sites
By Michael Appiah on January 26, 2026
ExpertBefore you start this troubleshooting, first log into your erpnext server and run cd ~/frappe-bench and proceed with the below instructions:
Step 1: Check Database (MariaDB) Status
The most common cause of a "500 Internal Server Error" in ERPNext is the database service being down or unresponsive.
- Check Status:
sudo systemctl status mariadb
- If the service is "Inactive" or "Failed": Restart it using:
sudo systemctl restart mariadb
- Verification: Run the status command again. If it fails to start, check the logs for corruption or memory issues:
sudo tail -f /var/log/mysql/error.log
Step 2: Restart Supervisor (App Layer)
If MariaDB is active but the site still shows an error, the Supervisor (which manages the Python/Gunicorn processes) may have stalled or crashed.
- Check Process Status:
sudo supervisorctl status
- Ensure all processes (web, workers, schedule) are "RUNNING".
- Restart Supervisor: If any process says "FATAL" or "BACKOFF," restart the entire group:
sudo supervisorctl restart all
Step 3: Restart Nginx (Web Server Layer)
Nginx acts as the reverse proxy. While it rarely causes a 500 error on its own (it usually throws a 502 or 504), a restart can clear stuck connections or configuration glitches.
- Restart Nginx:
sudo systemctl restart nginx
Step 4: The "Full Refresh" Command
If individual restarts don't work, use the Bench CLI to clear the cache and reset the site environment. Run these commands from within your frappe-bench directory:
bench clear-cachebench restart
Was this article helpful?
More articles on Erpnext