简体   繁体   中英

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

There seems to be a problem with Debian distributions (tested for both Wheezy and Squeeze) using Odoo for longpolling port. longpolling port is never used. It supposed to be used wen workers parameter is set to be greater than 0 , but it is not used anyway. But testing same thing on Ubuntu, longpolling port is used normally.

There is an original Question (last comment of the issue) https://github.com/odoo/odoo/issues/3793

checking nginx log I see this (everytime it tries to access longpolling through reverse proxy):

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"

And when I try to connect to 8072 port via telnet:

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

But trying for example:

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

So it seems that 8072 port is not used? In my odoo config it is set to be like this:

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

The problem was quite simple, but yet disguised. It was missing python package psycogreen . But it was not mentioned as dependency and when installing im_chat it didn't require such package. So if you were running Odoo with --workers=0 , then installed im_chat and later switched to for example --workers=2 , Odoo would not throw any error and longpolling port would never be opened.

Installing this solved it:

pip install psycogreen==1.0

Maybe you fixed it already, but seeing i have been looking for an answer and found a fix i'll post it. This made my Odoo 10 Enterprise installation work again:

  1. Install the Python dependencies with the following command: 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 .

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

  1. Make sure in your config you have workers = x X should be a number > 0

  2. If you are running behind a reverse proxy (apache / nginx), make sure your config file has the following line: proxy_mode = True

Hope this helps others who are having a similar issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM