[FIX] Odoo 20: bind http_interface 0.0.0.0 + http_port rename #1
No files matched your search
@@ -17,6 +17,16 @@ blueprint (battle-tested Sep 2026 on Odoo 19) — same architecture, retargeted:
|
||||
|
||||
## Deploy (one command + two MCP calls)
|
||||
|
||||
> **Odoo 20 delta (2026-11-10):** the generated `odoo.conf` now sets
|
||||
> `http_interface = 0.0.0.0` and `http_port = 8069`. Odoo 20's
|
||||
> `odoo/tools/config.py` defaults `http_interface` to `127.0.0.1` (and
|
||||
> force-resets it when empty), and the legacy `xmlrpc_port` key no longer
|
||||
> exists — without this fix Odoo binds loopback only and every request from
|
||||
> Traefik/the swarm VIP dies with `connection refused` → HTTP 502.
|
||||
> The init script also installs the `inotify` python package: Odoo 20's
|
||||
> `requirements.txt` no longer ships it, and `--dev=reload` silently
|
||||
> disables code autoreload without it.
|
||||
|
||||
```bash
|
||||
python3 deploy.py prepare # regenerates easypanel.schema.json, inline.Dockerfile, init-odoo.sh, .db_password
|
||||
```
|
||||
|
||||
@@ -110,6 +110,16 @@ def build_init_script() -> str:
|
||||
packages` + `--no-cache-dir` can exit non-zero on transient
|
||||
warnings (e.g. "Running as root") that should NOT kill the
|
||||
container. We instead rely on explicit early-exit points.
|
||||
* CRITICAL FIX #4 (Odoo 20): the generated odoo.conf MUST set
|
||||
`http_interface = 0.0.0.0` and use `http_port` (the old
|
||||
`xmlrpc_port` key no longer exists). Odoo 20's tools/config.py
|
||||
defaults `http_interface` to 127.0.0.1 AND force-resets it to
|
||||
127.0.0.1 when empty, so without the explicit line Odoo binds
|
||||
loopback only and Traefik/VIP connections are refused (502).
|
||||
* CRITICAL FIX #5 (Odoo 20): install the `inotify` python package.
|
||||
Odoo 20's requirements.txt no longer ships it, but `--dev=reload`
|
||||
requires it — without it odoo logs "'inotify' module not installed.
|
||||
Code autoreload feature is disabled" and NEVER restarts on edits.
|
||||
"""
|
||||
return textwrap.dedent(r"""
|
||||
#!/bin/bash
|
||||
@@ -148,6 +158,12 @@ def build_init_script() -> str:
|
||||
echo "[init] Odoo already installed; skipping pip install."
|
||||
fi
|
||||
|
||||
# Odoo 20: requirements.txt no longer ships the inotify package, but
|
||||
# --dev=reload needs it ("'inotify' module not installed. Code autoreload
|
||||
# feature is disabled"). Install unconditionally (cheap if present).
|
||||
pip install --quiet --no-cache-dir --break-system-packages inotify \
|
||||
|| echo "[init] WARN: inotify install failed (autoreload disabled)"
|
||||
|
||||
mkdir -p /etc/odoo /var/lib/odoo /var/log/odoo
|
||||
cat > /etc/odoo/odoo.conf <<EOF
|
||||
[options]
|
||||
@@ -161,7 +177,8 @@ def build_init_script() -> str:
|
||||
addons_path = /mnt/one-os-dev/addons,/mnt/one-os-dev/odoo/addons
|
||||
data_dir = /var/lib/odoo
|
||||
dev_mode = reload,qweb,assets,xml,werkzeug
|
||||
xmlrpc_port = 8069
|
||||
http_interface = 0.0.0.0
|
||||
http_port = 8069
|
||||
workers = 0
|
||||
log_level = info
|
||||
EOF
|
||||
|
||||
+8
-1
@@ -34,6 +34,12 @@ else
|
||||
echo "[init] Odoo already installed; skipping pip install."
|
||||
fi
|
||||
|
||||
# Odoo 20: requirements.txt no longer ships the inotify package, but
|
||||
# --dev=reload needs it ("'inotify' module not installed. Code autoreload
|
||||
# feature is disabled"). Install unconditionally (cheap if present).
|
||||
pip install --quiet --no-cache-dir --break-system-packages inotify \
|
||||
|| echo "[init] WARN: inotify install failed (autoreload disabled)"
|
||||
|
||||
mkdir -p /etc/odoo /var/lib/odoo /var/log/odoo
|
||||
cat > /etc/odoo/odoo.conf <<EOF
|
||||
[options]
|
||||
@@ -47,7 +53,8 @@ list_db = True
|
||||
addons_path = /mnt/one-os-dev/addons,/mnt/one-os-dev/odoo/addons
|
||||
data_dir = /var/lib/odoo
|
||||
dev_mode = reload,qweb,assets,xml,werkzeug
|
||||
xmlrpc_port = 8069
|
||||
http_interface = 0.0.0.0
|
||||
http_port = 8069
|
||||
workers = 0
|
||||
log_level = info
|
||||
EOF
|
||||
|
||||
+8
-1
@@ -36,6 +36,12 @@ else
|
||||
echo "[init] Odoo already installed; skipping pip install."
|
||||
fi
|
||||
|
||||
# Odoo 20: requirements.txt no longer ships the inotify package, but
|
||||
# --dev=reload needs it ("'inotify' module not installed. Code autoreload
|
||||
# feature is disabled"). Install unconditionally (cheap if present).
|
||||
pip install --quiet --no-cache-dir --break-system-packages inotify \
|
||||
|| echo "[init] WARN: inotify install failed (autoreload disabled)"
|
||||
|
||||
mkdir -p /etc/odoo /var/lib/odoo /var/log/odoo
|
||||
cat > /etc/odoo/odoo.conf <<EOF
|
||||
[options]
|
||||
@@ -49,7 +55,8 @@ list_db = True
|
||||
addons_path = /mnt/one-os-dev/addons,/mnt/one-os-dev/odoo/addons
|
||||
data_dir = /var/lib/odoo
|
||||
dev_mode = reload,qweb,assets,xml,werkzeug
|
||||
xmlrpc_port = 8069
|
||||
http_interface = 0.0.0.0
|
||||
http_port = 8069
|
||||
workers = 0
|
||||
log_level = info
|
||||
EOF
|
||||
|
||||
Reference in new issue
Block a user