This question has been flagged
2 Replies
15195 Views

Sometimes a blank page will appear(random) when the workers configuration is more than 0.

I watched the network connections .  something is not normal.

------

web.assets_common.js  filed   net::ERR_CONTENT_LENGTH_MISMATCH

web.assets_backend.js filed    net::ERR_CONTENT_LENGTH_MISMATCH.

-----

when i changed workers to 0, it's  ok.

Avatar
Discard
Best Answer

Try to set environment variable ODOO_HTTP_SOCKET_TIMEOUT=10

See for explanation: https://github.com/odoo/odoo/commit/49e3fd102f11408df00f2c3f6360f52143911d74

Avatar
Discard

Hi Ivan, I am facing same issue. When i put worker =0 randomly ERR_CONTENT_LENGTH_MISMATCH occurs. I have not installed or configured nginx/apache. And in which file i have set ODOO_HTTP_SOCKET_TIMEOUT ? Can you pls give more details as i am new to the deployment

Shashank, If you use docker deployment check this https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file and this https://docs.docker.com/compose/environment-variables/ . If you use odoo_bin, you can add ODOO_HTTP_SOCKET_TIMEOUT=10 right before the odoo_bin command

@Ivan Elizaryev, you are my true saver. Thank you very much.

I set in my systemd service file like this and worked like charm.

Environment="ODOO_HTTP_SOCKET_TIMEOUT=30"

Maybe this is critical to change with this high value. Anyway, I found the problem and needed to fix it as best I could. Thank you again.

Cheers.

Where can we set this environment variable in init.d script

@Ivan Elizaryev, you are the best! net::ERR_CONTENT_LENGTH_MISMATCH solved completely.

where i should insert the "ODOO_HTTP_SOCKET_TIMEOUT=10" if i'm using Centos 7 with odoo14 CE and not using docker or something else.

Best Answer

We fixed the issue by setting environment variable ODOO_HTTP_SOCKET_TIMEOUT as indicated below (and switched from init.d to systemd because we could not find a way to set an environment variable using init.d).

[Unit]
Description=Odoo Open Source ERP and CRM
After=network.target

[Service]
Environment="ODOO_HTTP_SOCKET_TIMEOUT=30"
Type=simple
User=odoo
Group=odoo
#ExecStart=/usr/bin/odoo --config /etc/odoo/odoo.conf --logfile /var/log/odoo/odoo-server.log
ExecStart=/opt/odoo/odoo-server/odoo-bin --config=/etc/odoo/odoo.conf --logfile /var/log/odoo/odoo-server.log
KillMode=mixed

[Install]
WantedBy=multi-user.target
Avatar
Discard