Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Polling process can't connect to DB over a NGINX reverse proxy

Odoberať

Get notified when there's activity on this post

This question has been flagged
messagesnginxchatproxyreverse
1 Odpoveď
15456 Zobrazenia
Avatar
Diego González

Hi everybody! I'm struggling with an 500 HTTP error fired by the polling proccess (used for IM messages) -as far as I can understand, beacuse the polling proccess can't connect to PostgreSQL (but Odoo main process can, though)


Symptom

Everything in Odoo works just fine, except ONLY for the IM: messagges doesn't refresh automatically and Odoo accuses of losing connection and getting it back automatically (sometimes the session even expires).

No IM message is lost: refreshing the webpage shows the latest IM messages.


Enviroment

  • VM witth 4 virtual processors and 16 GB of RAM
  • Ubuntu 20.04
  • Odoo 14 Community Edition
  • NGINX as a reverse proxy


Configuration files

Odoo.conf

[options]
addons_path = ...
admin_passwd = ...
csv_internal_sep = ,
data_dir = /var/lib/odoo/.local/share/Odoo
db_host = localhost
db_maxconn = 64
db_name = False
db_password = ...
db_port = 5432
db_sslmode = prefer
db_template = template0
db_user = odoo
dbfilter = odoo
list_db = False
demo = {}
email_from = False
geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb
http_enable = True
http_interface =
http_port = 8069
import_partial =
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 120
limit_time_real = 240
limit_time_real_cron = -1
; xmlrpc = True ; Already tried uncommenting this
; xmlrpcs = False ; Already tried uncommenting this
; xmlrpc_port = 8069 ; Already tried uncommenting this
log_db = False
log_db_level = warning
log_handler = :INFO
log_level = info
logrotate = True
logfile = /var/log/odoo/odoo-server.log
longpolling_port = 8072
max_cron_threads = 4
osv_memory_age_limit = False
osv_memory_count_limit = False
pg_path =
pidfile =
proxy_mode = True
reportgz = False
screencasts =
screenshots = /tmp/odoo_tests
server_wide_modules = base,web
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_user = False
syslog = False
test_enable = False
test_file =
test_tags = None
transient_age_limit = 1.0
translate_modules = ['all']
unaccent = False
upgrade_path =
without_demo = False
workers = 9 ; Already tried with 2. As there are 4 virtual CPUs: 9 = 4*2 + 1


NIGINX

# Odoo Upstreams
upstream intranet.com {
server 127.0.0.1:8069;
}

upstream intranet-chat.com {
server 127.0.0.1:8072;
}

# http to https redirection
server {
listen 80;
server_name intranet.com;
server_name www.intranet.com;
return 301 https://intranet.com$request_uri;
}

server {
listen 443 ssl;
server_name intranet.com;
access_log /var/log/nginx/odoo_access.log;
error_log /var/log/nginx/odoo_error.log;

# SSL
ssl_certificate /etc/nginx/certificates/intranet.crt;
ssl_certificate_key /etc/nginx/certificates/intranet.rsa;

# Proxy settings
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
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;

# Request for root domain
location / {
proxy_redirect off;
proxy_pass http://intranet.com;
}

# Chat
location /longpolling { # Commenting this block causes the 500 HTTP error not reporting but the issue persists (IM messages doesn't show automatically)
proxy_pass http://intranet-chat.com;
}

# Cache static files
location ~* /web/static/ {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://intranet.com;
}

# Gzip compression
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;

}


PostgreSQL

# TYPE  DATABASE        USER            ADDRESS                 METHOD
local all all peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5


Logs

Chrome console (shows repeatedly this message)

web.assets_common.js:formatted:15849 POST https://intranet.com/longpolling/poll 500 (Internal Server Error)


odoo.log (shows repeatedly this message)

2021-06-24 22:33:33,958 269061 INFO ? longpolling: 192.168.40.36 - - [2021-06-24 22:33:33] "POST /longpolling/poll HTTP/1.0" 500 140 0.001650
2021-06-24 22:33:33,967 269061 INFO ? odoo.sql_db: Connection to the database failed


NGINX odoo_error.log (shows repeatedly this message)

2021/06/24 16:52:08 [error] 302077#302077: *56538 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.40.36, server: intranet.com, request: "POST /longpolling/poll HTTP/1.1", upstream: "http://127.0.0.1:8072/longpolling/poll", host: "intranet.com", referrer: "https://intranet.com/web"


Troubleshooting

root@SRVODOO:/etc/odoo# netstat -ntlp | grep LISTEN
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 804/nginx: master p
tcp 0 0 0.0.0.0:8069 0.0.0.0:* LISTEN 713/python3
tcp 221 0 0.0.0.0:8072 0.0.0.0:* LISTEN 967/python3
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 804/nginx: master p
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 687/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 758/sshd: /usr/sbin
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 821/postgres
tcp6 0 0 :::22 :::* LISTEN 758/sshd: /usr/sbin
tcp6 0 0 :::5432 :::* LISTEN 821/postgres

root@SRVODOO:/etc/odoo# telnet 127.0.0.1 8072
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.


root@SRVODOO:/etc/odoo# ufw status
Status: active

To Action From
-- ------ ----
22/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
8069 ALLOW Anywhere
443/tcp ALLOW Anywhere
25/tcp ALLOW Anywhere
389 ALLOW Anywhere
5432 ALLOW Anywhere
8072 ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
8069 (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
25/tcp (v6) ALLOW Anywhere (v6)
389 (v6) ALLOW Anywhere (v6)
5432 (v6) ALLOW Anywhere (v6)
8072 (v6) ALLOW Anywhere (v6)


Notes

  • If I undo the polling in the NGINX reverse proxy, the issue persists, but no error is logged.
  • Even though the NGINX error log suggest that the polling process is not connecting to PostgreSQL, Odoo works just perfect (and IM messages arrives -it just doesn't appear automatically).
  • Already tried disabling UFW.
1
Avatar
Zrušiť
Avatar
Adil Akbar
Best Answer

Hi, you can follow this: https://youtu.be/-3wV7A_4s-w

Hope it helps

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Error redirection url after logout with nginx proxy Solved
nginx proxy odoo
Avatar
Avatar
Avatar
3
máj 24
24079
Odoo 16 Multi Worker Configuration
nginx proxy odoo16features
Avatar
0
okt 22
5038
How to configure nginx proxy manager for odoo 16? Solved
api nginx proxy docker
Avatar
Avatar
Avatar
Avatar
Avatar
9
jan 25
17447
Odoo 10 CE - chat is not refreshing on SSL connection Solved
messages chat ssl refresh
Avatar
Avatar
Avatar
Avatar
Avatar
7
jan 24
15452
Reverse proxy not passing correctly
nginx proxy reverse_proxy odoov11
Avatar
Avatar
1
dec 20
10144
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now