本文介绍了Odoo总线不可用。总线不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在docker中本地运行Odoo v14时,我经常收到以下错误信息:

odoo-14.0-stage    | 2021-04-26 10:51:00,476 10 ERROR update odoo.http: Exception during JSON request handling. 
odoo-14.0-stage    | Traceback (most recent call last):
odoo-14.0-stage    |   File "/home/odoo/addons/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
odoo-14.0-stage    |     result = request.dispatch()
odoo-14.0-stage    |   File "/home/odoo/addons/odoo/odoo/http.py", line 683, in dispatch
odoo-14.0-stage    |     result = self._call_function(**self.params)
odoo-14.0-stage    |   File "/home/odoo/addons/odoo/odoo/http.py", line 359, in _call_function
odoo-14.0-stage    |     return checked_call(self.db, *args, **kwargs)
odoo-14.0-stage    |   File "/home/odoo/addons/odoo/odoo/service/model.py", line 94, in wrapper
odoo-14.0-stage    |     return f(dbname, *args, **kwargs)
odoo-14.0-stage    |   File "/home/odoo/addons/odoo/odoo/http.py", line 347, in checked_call
odoo-14.0-stage    |     result = self.endpoint(*a, **kw)
odoo-14.0-stage    |   File "/home/odoo/addons/odoo/odoo/http.py", line 912, in __call__
odoo-14.0-stage    |     return self.method(*args, **kw)
odoo-14.0-stage    |   File "/home/odoo/addons/odoo/odoo/http.py", line 531, in response_wrap
odoo-14.0-stage    |     response = f(*args, **kw)
odoo-14.0-stage    |   File "/home/odoo/addons/odoo/addons/bus/controllers/main.py", line 35, in poll
odoo-14.0-stage    |     raise Exception("bus.Bus unavailable")
odoo-14.0-stage    | Exception
odoo-14.0-stage    | 
odoo-14.0-stage    | The above exception was the direct cause of the following exception:
odoo-14.0-stage    | 
odoo-14.0-stage    | Traceback (most recent call last):
odoo-14.0-stage    |   File "/home/odoo/addons/odoo/odoo/http.py", line 639, in _handle_exception
odoo-14.0-stage    |     return super(JsonRequest, self)._handle_exception(exception)
odoo-14.0-stage    |   File "/home/odoo/addons/odoo/odoo/http.py", line 315, in _handle_exception
odoo-14.0-stage    |     raise exception.with_traceback(None) from new_cause
odoo-14.0-stage    | Exception: bus.Bus unavailable

我的dono.conf文件:

[options]

# Service Settings
addons_path = /home/odoo/addons/odoo/addons,/home/odoo/addons/extra,/home/odoo/custom/custom_addons,/home/odoo/custom/edited_addons,/home/odoo/custom/paysy_addons
data_dir = /var/lib/odoo

# Database
db_host = postgres-12.2
db_user = odoo_13_0_stage
db_password = password

# Tuning Options
workers = 2
max_cron_threads = 1
limit_time_cpu = 600
limit_time_real = 1200
osv_memory_age_limit = 1.0
osv_memory_count_limit = False

# Network / Ports
xmlrpc_port = 8069
netrpc_port = 8070
xmlrpcs_port = 8071
longpolling_port = 8072
proxy_mode = True

我认为这与长投票有关,但不确定。如您所见,我已经设置了PROXY_MODE为真,配置了长轮询端口,并设置了2个工作进程。我还尝试按照其他地方的建议配置零个或两个以上的工作进程。

希望有人能帮忙。

ps:跟随我的docker撰写文件:

version: "3.9"
services:

    odoo-14.0-stage:
        container_name: odoo-14.0-stage
        image: odoo-14.0:stage
        build: ./volumes/
        ports:
            - 13001:8069/tcp
            - 8070:8070
            - 8071:8071
            - 8072:8072
        depends_on:
            - postgres-12.2
        volumes:
            - ./config:/etc/odoo:ro
            - ./volumes:/home/odoo/addons
            - ./addons:/home/odoo/custom
            - ./data:/var/lib/odoo
        restart: always

    postgres-12.2:
        container_name: postgres-12.2
        image: postgres:12.2
        build: ./postgres/12.2/
        volumes:
            - ./postgres/12.2/volumes/data:/var/lib/postgresql/data:delegated
        restart: always

推荐答案

这些日志以一种隐晦的方式告诉您需要正确配置代理。

Odoo正常操作通过Main(也称为HTTP)端口完成,该端口默认为8069。但是,长轮询请求略有不同:

  • 在线程模式下(workers = 0,最适合开发),它们通过相同的8069端口。
  • 在多进程模式(workers = 2或更多,最适合生产)中,它们使用默认侦听端口8072的特定进程。

您的浏览器对Odoo的配置一无所知。它只是通过同一端口发出所有请求,不管是什么端口(提示:HTTP默认使用80,HTTPS使用443)。

这就是为什么在多进程模式下使用Odoo时,在Web浏览器和Odoo之间必须有一个反向代理,根据路径将请求定向到正确的端口。

Odoo文档提供了nginx配置示例和更多详细信息。检查它们:https://www.odoo.com/documentation/14.0/administration/install/deploy.html#id7

这篇关于Odoo总线不可用。总线不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 03:26