Odoo(在 Debian 上)- 长轮询端口永远不会 used/opened

Odoo (on Debian) - longpolling port is never used/opened

使用 Odoo 作为长轮询端口的 Debian 发行版(针对 Wheezy 和 Squeeze 进行了测试)似乎存在问题。永远不会使用长轮询端口。它应该在 workers 参数设置为大于 0 时使用,但无论如何都没有使用。但是在 Ubuntu 上测试同样的事情,longpolling 端口使用正常。

有一个原始问题(问题的最后评论)https://github.com/odoo/odoo/issues/3793

检查 nginx 日志我看到这个(每次它试图通过反向代理访问 longpolling):

2015/05/08 07:54:09 [error] 32494#0: *8 connect() failed (111: Connection refused) while connecting to upstream, client: IP address, server: _, request: "POST /longpolling/poll HTTP/1.1", upstream: "http://127.0.0.1:8072/longpolling/poll", host: "db.host.eu", referrer: "http://db.host.eu/web"

当我尝试通过 telnet 连接到 8072 端口时:

$ telnet 127.0.0.1 8072
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

但是举个例子:

$ telnet 127.0.0.1 8069
Trying 127.0.0.1...
Connected to 127.0.0.1.

所以好像8072端口没有用? 在我的 odoo 配置中,它被设置成这样:

longpolling_port = 8072
xmlrpc_port = 8069
workers = 2
xmlrpc_interface = 127.0.0.1
netrpc_interface = 127.0.0.1

问题很简单,但又很隐蔽。它缺少 python 包 psycogreen。但是它没有被提及为依赖项,并且在安装 im_chat 时它不需要这样的包。所以如果你是 运行 Odoo 和 --workers=0,然后安装 im_chat 然后切换到例如 --workers=2,Odoo 不会抛出任何错误并且长轮询端口永远不会打开。

安装这个解决了它:

pip install psycogreen==1.0

也许您已经修复了它,但看到我一直在寻找答案并找到了修复方法,我会 post 它。 这使我的 Odoo 10 Enterprise 安装再次工作:

  1. 使用以下命令安装 Python 依赖项: sudo apt-get install python-dateutil python-docutils python-feedparser python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python -vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi poppler-utils python-pip python-pypdf python-passlib python-decorator gcc python-dev mc bzr python-setuptools python-markupsafe python-reportlab-accel python-zsi python-yaml python-argparse python-openssl python-egenix-mxdatetime python -usb python-serial lptools make python-pydot python-psutil python-paramiko poppler-utils python-pdftools antiword python-requests python-xlsxwriter python-suds python-psycogreen python-ofxparse python-gevent .

(致谢:https://www.getopenerp.com/install-odoo-10-on-ubuntu-16-04/)。

  1. 确保您的配置中有 workers = x X 应该是一个数字 > 0

  2. 如果您 运行 在反向代理 (apache / nginx) 后面,请确保您的配置文件包含以下行: proxy_mode = 真

希望这对遇到类似问题的其他人有所帮助