Odoo设置workers后的错误解决办法
Posted kxxx
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Odoo设置workers后的错误解决办法相关的知识,希望对你有一定的参考价值。
参考:
http://blog.sina.com.cn/s/blog_7cb52fa80102vrri.html
odoo 在配置workers后会有如下错误
Traceback (most recent call last):
File "/opt/odoo/openerp/http.py", line 530, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/openerp/http.py", line 567, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/openerp/http.py", line 303, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/openerp/http.py", line 300, in checked_call
return self.endpoint(*a, **kw)
File "/opt/odoo/openerp/http.py", line 796, in __call__
return self.method(*args, **kw)
File "/opt/odoo/openerp/http.py", line 396, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/addons/bus/bus.py", line 188, in poll
raise Exception("bus.Bus unavailable")
原因:
工人> 0会有很多线程在端口8069上。
你也会有几个cron线程8069(max-cron-threads)。
一个gevent线程在端口8072上(longpolling-port)。
这里的问题就在8072上,web会用8069请求longpolling。所以http出错。
解决办法:
通过设置反向代理的方式来解决
反向代理设置参考:https://www.myfreax.com/add-nginx-reverse-proxy-for-odoo/
1、安装nginx作为反向代理,需要配置nginx的conf文件,其文件内容加入:
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoo-chat {
server 127.0.0.1:8072;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
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;
location / {
proxy_pass http://odoo;
proxy_redirect off;
}
location /longpolling/ {
proxy_pass http://odoo-chat;
proxy_redirect off;
}
location ~* /web/static/ {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo;
}
2、修改odoo.conf文件,设置为代理,
workers = 3
proxy_mode = True
#如果需要禁止外部机器访问8069端口,需要加入下面的配置
xmlrpc_interface = 127.0.0.1
netrpc_interface = 127.0.0.1
至此,重启nginx和odoo服务后,问题将可以得到解决.
以上是关于Odoo设置workers后的错误解决办法的主要内容,如果未能解决你的问题,请参考以下文章
odoo中安装了错误的模块,导致网页报错进不去,怎么修改后的上传
NDK: ant 错误 [javah] Exception in thread "main" java.lang.NullPointerException 多种解决办法(代码片段