コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
7192 ビュー

[16] in odoo 16 longpolling is not working cannot use the chat, it do not refresh

Now the chat is useless, it does not refresh

Lonpolling is deprecated but no one knows how to fix this problem

There is no alternative configuration

someon said 


longpolling_port = False
gevent_port = 8072

but does not work


I do not have errors , but the chat do not refresh

アバター
破棄

me too:(

Have the same problem! Odoo 16 CE. Does you find a solution?

最善の回答

Use instead location/longpolling 

location/websocket 

The documentation for odoo 16 is wrong, better use odoo17 nginx configuration

#odoo server
upstream odooerp {
server 127.0.0.1:8069;
}
upstream odoochaterp {
server 127.0.0.1:8072;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

# http -> https


server {
server_name your_domain;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;


# log
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;

# Redirect websocket requests to odoo gevent port
location /websocket {
proxy_pass http://odoochaterp;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}

# Redirect requests to odoo backend server
location / {
# Add Headers for odoo proxy mode
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://odooerp;

}
# common gzip
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
gzip on;


}






Set the ssl with certbot:

sudo certbot --nginx -d your_domain 

This works for me.
Not forget to set the gevent_port and workers=2 or more in odoo.conf

アバター
破棄
最善の回答

Hi,


It seems like you are facing an issue with long polling in Odoo 16, and the chat functionality is not refreshing. The provided configuration for Nginx includes settings for long polling and WebSocket, but it might not be resolving the problem.


To address this, you can try the following steps:


Update Nginx Configuration:


Ensure that your Nginx configuration is correctly set up. The provided configuration includes settings for long polling and WebSocket, but you may need to adapt it based on your specific server setup.


Nginx


upstream odoo {

    least_conn;  

    server 127.0.0.1:8039;

    server 127.0.0.1:8047;

}


server {

    listen 443 ssl;

    server_name odoo_dev_test.com;

    ssl on;

    ssl_certificate /etc/nginx/ssl/certificate.pem;

    ssl_certificate_key /etc/nginx/ssl/key.pem;

    ssl_session_timeout 30m;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RS$';

    ssl_prefer_server_ciphers on;

    gzip on;

    gzip_min_length 1000;


    location / {

        proxy_pass http://odoo;

        proxy_set_header Host $host;

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header X-Forwarded-Proto $scheme;

    }


    location /longpolling {

        proxy_pass http://odoo;

        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;

        proxy_set_header Connection "upgrade";

        proxy_set_header Host $host;

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header X-Forwarded-Proto $scheme;

    }


    location /websocket {

        proxy_pass http://odoo;

        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;

        proxy_set_header Connection "upgrade";

        proxy_set_header Host $host;

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header X-Forwarded-Proto $scheme;

    }

}


also please refer this doc for more clarification

https://www.odoo.com/documentation/17.0/administration/install/deploy.html#https

アバター
破棄