您的位置:首页 > 大数据 > 人工智能

odoo worker 异常Exception("bus.Bus unavailable")

2015-11-24 23:01 1526 查看
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出错。

 

解决方法:

安装返向代理,用http://host:80代理 http://localhost:8069/http://localhost:8072/longpolling即可
 

如nginx配置

 

Conf代码  


location / {  

        proxy_pass        http://localhost:8069/;  

        proxy_redirect    off;  

        proxy_set_header  X-Real-IP        $remote_addr;  

        proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;  

}  

  

location /longpolling/ {  

        proxy_pass        http://localhost:8072/longpolling/;  

        proxy_redirect    off;  

        proxy_set_header  X-Real-IP        $remote_addr;  

        proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;  

}  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python