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

来源:互联网 发布:mac黑屏音乐不播放 编辑:程序博客网 时间:2024/05/14 05:41

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代码  收藏代码
  1. location / {  
  2.         proxy_pass        http://localhost:8069/;  
  3.         proxy_redirect    off;  
  4.         proxy_set_header  X-Real-IP        $remote_addr;  
  5.         proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;  
  6. }  
  7.   
  8. location /longpolling/ {  
  9.         proxy_pass        http://localhost:8072/longpolling/;  
  10.         proxy_redirect    off;  
  11.         proxy_set_header  X-Real-IP        $remote_addr;  
  12.         proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;  
  13. }  
0 0