Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
12 Odgovori
12238 Prikazi

My Odoo is showing a Yellow Box around the screen and the message "Real-time connection lost" when I login using my website address. Is there a fix to this? I am missing a port that needs to be open?

Avatar
Opusti

This is a new feature added by Odoo lately to help you if there is a disconnection to the Odoo server so you need to check you Odoo and (nginx or apache) configuration

Avtor

Setting workers in the Odoo.conf to my (CPU*2)+1 has not helped with the error message. The Error does not show up if I connect directly from the Windows Machine that is running Odoo (localhost:8069). It only appears when connecting through the IIS setup.

Same Error, anyone know fix it?

Best Answer

Make sure you are adding 
proxy_mode = True

gevent_port = 8072

workers = 3

max_cron_threads = 1

longpolling_port = False



in your ngnix conf add /websocket block


location /websocket {

    proxy_pass http://odoochat;

    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;


    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";

#    proxy_cookie_flags session_id samesite=lax secure;  # requires nginx 1.19.8

  }

please do not forget to define these above your server block in ngninx

#odoo server

upstream odoo {

  server 127.0.0.1:8069;

}

upstream odoochat {

  server 127.0.0.1:8072;

}

map $http_upgrade $connection_upgrade {

  default upgrade;

  ''      close;

}



this solved my problem

Avatar
Opusti

This solved my problem too.

Many thanks.

Best Answer

Found this post, after a git pull update, Odoo 18.0 branch. Reverted changes to previous commit and the error is gone. I'm sure this is a recent bug to be identified yet.

Avatar
Opusti

Thanks for sharing this. Which commit ID did you revert to? I’d like to try using that commit as well.

I went back to that commit and it works! The ‘Real-time connection lost’ message is gone. I hope they fix this bug soon. Thanks, Fabio!

Best Answer

I’m setting up a Digital Ocean VPS with 2GB RAM and 1 vCPU to run Odoo 18 Community. The server displays an error message “Real-time connection lost…” constantly on the bottom-right corner of the screen. I’ve changed the worker number in the Odoo Server configuration file and restarted the server, but the error persists. Interacting with the server indicates no issues. I can install the Odoo module or change settings. However, the message remains, suggesting a potential server connection problem which makes it impossible to know if there is a connection problem. Is this a bug?

PS: BTW, I have followed the tutorial video on this link: https://www.youtube.com/watch?v=Q1c5XpG85OE

Avatar
Opusti
Best Answer

I has same problem on odoo+nginx proxy mode configuration. any one can fix this?

Avatar
Opusti
Best Answer

I just fought with this exact issue for 2 straight days before I finally found the solution to my specific use case, so maybe this will help someone else.

I am running Odoo 18 Community, and its Postgres database, inside docker containers on Ubuntu. Both are created by a docker-compose.yml file. I am using Nginx as a reverse proxy installed on the main Ubuntu os, and Cloudflare for DNS and domain hosting.

The "accepted answer" for what to include in the Nginx config and the Odoo config are both a large part of what I needed, but the final needle in the haystack for my setup was that my docker-compose needed to also include port 8072 in it. I've also seen port 8071 indicated in places for something, so I added that too just in case. So my docker-compose is now:

version: '3'
services:
​odoo:
​image: odoo:18.0
​env_file: .env
​depends_on:
​- postgres
​ports:
​- "127.0.0.1:8069:8069"
​- "127.0.0.1:8072:8072"
​- "127.0.0.1:8071:8071"
​volumes:
​- data:/var/lib/odoo
​- ./addons:/mnt/extra-addons
​- ./config:/etc/odoo
​restart: unless-stopped
​postgres:
​image: postgres:16
​env_file: .env
​volumes:
​- db:/var/lib/postgresql/data/pgdata
​restart: unless-stopped

volumes:
​data:
​db:


Now that yellow box and message is gone :)

Avatar
Opusti
Best Answer

for all those struggling with nginx, just follow official documentation and posted solution
don't forget following block to enable connection upgrade in /websocket location

}
map $http_upgrade $connection_upgrade {
  default upgrade;
  ''      close;
}
Avatar
Opusti
Avtor Best Answer

in your ngnix conf add /websocket block


location /websocket {

    proxy_pass http://odoochat;

    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;


    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";

#    proxy_cookie_flags session_id samesite=lax secure;  # requires nginx 1.19.8

  }

please do not forget to define these above your server block in ngninx

#odoo server

upstream odoo {

  server 127.0.0.1:8069;

}

upstream odoochat {

  server 127.0.0.1:8072;

}

map $http_upgrade $connection_upgrade {

  default upgrade;

  ''      close;

}

How would I do with with IIS on Windows?

Avatar
Opusti
Best Answer

I'm having the same issue. It is driving me crazy. I'm using Bitnami's Odoo package bitnami com/stack/odoo/virtual-machine on a VM Google Cloud instance. This package uses Apache as proxy. I thought it had to do with the SSL certificates, so I generated SSL for the subdomain I'm using but that didn't work either. The "Real-time error" is still there and the chat does not work in real time, neither calls & video calls. Not sure what else might be affected with this "Real-time error".


Below the 400 error related to the websocket not working:


2025-01-27 05:54:34,051 77881 INFO bitnami_odoo werkzeug: 201.152.145.175 - - [27/Jan/2025 05:54:34] "GET /websocket?version=18.0-3 HTTP/1.1" 400 - 1 0.001 0.002


2025-01-27 05:54:37,942 77879 INFO bitnami_odoo werkzeug: 201.152.145.175 - - [27/Jan/2025 05:54:37] "GET /websocket?version=18.0-3 HTTP/1.1" 400 - 1 0.001 0.003


2025-01-27 05:54:39,253 77879 INFO bitnami_odoo werkzeug: 201.152.145.175 - - [27/Jan/2025 05:54:39] "GET /websocket?version=18.0-3 HTTP/1.1" 400 - 1 0.001 0.002


2025-01-27 05:54:40,693 77879 INFO bitnami_odoo werkzeug: 201.152.145.175 - - [27/Jan/2025 05:54:40] "GET /websocket?version=18.0-3 HTTP/1.1" 400 - 1 0.001 0.002


I tried troubleshooting with ChatGPT and Gemini with no luck. Would be great to know if this is a bug, so I could stop trying to figure a workaround. Any advice or update would be greatly appreciated!

Avatar
Opusti
Best Answer

I using nginx as a reverse proxy with HTTPS for my Odoo18 setup.


In the odoo.conf file:

  • When I set workers = (CPU*2)+1, the Nginx domain works fine, but accessing Odoo directly via http://{odoo_ip}:8069 throws a "Real-time connection lost" error.
  • On the other hand, if I do not set the workers parameter, the Nginx domain throws an error, but accessing Odoo directly via http://{odoo_ip}:8069 works without issues.

Avatar
Opusti

Here is my nginx setting, exctually i am not really know using "websocket" or "longpolling" for odoo18 live -chat.
"""
upstream odoo_chat {
server {odoo_ip}:8072;
}

location /websocket {
proxy_pass http://odoo_chat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Host $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;

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
proxy_cookie_flags session_id samesite=lax secure;

proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
}

location /longpolling/ {
proxy_pass http://odoo_chat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_read_timeout 3600s;
}
"""

Best Answer

Hi,
I think this is about longpolling port is set and gevent port is not set.

I am fixed it with.
In odoo.conf .

longpolling_port = False
gevent_port = 8072

you can also look at ( I cant share Link because of karma. )
deprecationwarning-the-longpolling-port-is-a-deprecated-alias-to-the-gevent-port-option-please-use-the-latter-214918

Avatar
Opusti

I tried fixed it, it still happens. But if I access it through port 8069 not show "Real-time connect lost...".

Best Answer

thanks Niyas ! but this is slightly different case in the YouTube video (man funny how people make it a 5 minutes videos these days! it's like one change in conf for number of worker processes :) 

What Fabio posted might be it, but kind of weird how would it be related

Colin were you able to find a fix for this? What does it mean anyways, is this connection to real-time chat, or something like this? 

PS tried Onur's suggestion but that didn't work for me..

Avatar
Opusti
Best Answer

Hi,
Can you check and see if this helps: Fix Connection Lost and Connection Restored Error Odoo

Thanks

Avatar
Opusti

Not working!

Related Posts Odgovori Prikazi Aktivnost
0
apr. 25
3
7
apr. 25
1309
1
apr. 25
197
0
apr. 25
145
3
mar. 25
2157