Skip to content

Fix Odoo Website 500 Internal Server Error: Causes and Solutions

DeployMonkey Team · March 23, 2026 10 min read

The Problem

Your Odoo website was working fine, and suddenly some or all pages show a generic "500 Internal Server Error" or Odoo's "Something went wrong" error page. The backend works fine, but the website is down. This can happen after a module update, a configuration change, or seemingly out of nowhere.

What a 500 Error Means

A 500 error means the server crashed while rendering the page. Unlike a 404 (page not found), 500 means the page exists but the code to render it threw an exception. The real error is in the Odoo server logs, not in the browser.

Step 1: Check the Logs

Always start by reading the Odoo server logs. The 500 page hides the real error.

# Check logs:
tail -100 /var/log/odoo/odoo-server.log

# Or if running in terminal:
# The error traceback prints directly to stdout

# Common log locations:
# /var/log/odoo/odoo-server.log
# /var/log/odoo/odoo.log
# Docker: docker logs odoo-container

Common Causes and Fixes

1. Broken QWeb Template

The most common cause. A syntax error in a QWeb template crashes the entire page.

Error in logs:

QWebException: 'NoneType' object has no attribute 'id'
Template: website.layout
Error: in t-foreach="website.menu_id.child_id" at line 42

Fix:

  • Go to Settings > Technical > User Interface > Views
  • Search for the template name from the error
  • Check the XML for syntax errors
  • If a custom template broke it, disable the custom view to restore the default

2. Missing Record Referenced in Template

A template references a record (menu, page, product) that was deleted.

Error in logs:

MissingError: Record does not exist or has been deleted.
(Record: website.page(42,), User: 2)

Fix: Recreate the missing record or update the template to remove the reference. In the database:

# Find what references the deleted record:
SELECT arch_db FROM ir_ui_view 
WHERE arch_db LIKE '%website.page(42%';

3. Asset Bundle Corruption

Broken or stale CSS/JS asset bundles can cause 500 errors, especially after module updates.

Fix:

# Clear assets and regenerate:
# 1. In debug mode (?debug=1):
# Settings > Technical > Regenerate Assets Bundle

# 2. Or via database:
DELETE FROM ir_attachment 
WHERE url LIKE '/web/assets/%' 
   OR url LIKE '/web/content/%asset%';

# 3. Restart Odoo after clearing assets

4. Module Update Broke Views

After running -u on a module, view inheritances may conflict.

Fix:

# Find broken views:
SELECT v.name, v.model, v.type, v.active 
FROM ir_ui_view v 
WHERE v.model = 'ir.ui.view' 
  AND v.active = false 
  AND v.website_id IS NOT NULL;

Try updating the website module: ./odoo-bin -d mydb -u website --stop-after-init

5. Controller Exception

A Python error in a website controller (route handler) causes a 500 for that specific URL.

Error in logs:

TypeError: _render_page() got an unexpected keyword argument 'slug'
File "/odoo/addons/website/controllers/main.py", line 123, in page

Fix: Check custom controllers that override website routes. Common issues:

  • Method signature changed after Odoo upgrade
  • Missing import or dependency
  • Database query error in controller code

6. Database Connection Issues

If the database is overloaded or connections are exhausted, all pages return 500.

Error in logs:

psycopg2.OperationalError: FATAL: too many connections for role "odoo"
psycopg2.OperationalError: could not connect to server: Connection refused

Fix:

  • Check PostgreSQL connections: SELECT count(*) FROM pg_stat_activity;
  • Increase max_connections in postgresql.conf
  • Reduce Odoo workers: workers = 4 in odoo.conf
  • Check for long-running queries: SELECT pid, now() - query_start, query FROM pg_stat_activity WHERE state = 'active' ORDER BY query_start;

7. Memory Exhaustion

If an Odoo worker runs out of memory, it is killed by the OS, causing a 500.

Fix:

# Check memory limits in odoo.conf:
limit_memory_hard = 2684354560  # 2.5 GB
limit_memory_soft = 2147483648  # 2 GB

# Check system memory:
free -h

# Check OOM killer logs:
dmesg | grep -i "out of memory"
dmesg | grep -i "killed process"

8. SSL/Proxy Misconfiguration

If nginx or a reverse proxy is misconfigured, it may pass wrong headers causing Odoo to crash.

Fix: Ensure your nginx config includes:

proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;

And in odoo.conf: proxy_mode = True

Quick Diagnostic Checklist

  1. Read the Odoo server logs — the real error is there
  2. Check if all pages are 500 (system issue) or just specific ones (template/controller issue)
  3. Check if backend works — if yes, it is a website-specific issue
  4. Try accessing with ?debug=1 for more detail
  5. Check disk space: df -h
  6. Check database connections
  7. Try restarting Odoo