Skip to Content
Menu
This question has been flagged
7 Replies
2108 Views

we use odoo 12 (local version) since 1,5 years now.

since some weeks users get disconnect/reconnected Messages about 5-8 times per day.


Server (odoo and DB) runs on a VM with:

8 Cores

32GB RAM


Number of Sale-Orders in System: about 400000


we alreay found some threads regarding this topic but only solution there was to increase workers.


Odoo will be used by about 16 people (most time working in the erp sales/stock).


we already increased workers to 17 but still some disconnects occure during the day.


at this times we do not see any errors in odoo/nginx/postgres logs.



while monitoring the PG-Activity we sometimes see Messages like:

158806 odoonewDB 150854 odoo 52/45391 AccessShareLock Yes 2020-10-21 08:23:48+02 SELECT "printing_job"."id" as "id","printing_job"."name" as "name","printing_job"."active" as "active","printing_job"."job_id_cups" as "job_id_cups","printing_job"."printer_id" as "printer_id","printing_job"."time_at_processing" as "time_at_processin


158608 odoonewDB 161168 odoo 13/54879 AccessShareLock Yes 2020-10-21 08:26:16+02 SELECT "product_template"."id" as "id","product_template"."uom_id" as "uom_id","product_template"."list_price" as "list_price","product_template"."responsible_id" as "responsible_id","product_template"."expense_policy" as "expense_policy","product_te


208765 odoonewDB162179 odoo 32/55958 AccessShareLock Yes 2020-10-21 08:26:39+02 SELECT "sale_order"."id" as "id","sale_order"."fiscal_position_id" as "fiscal_position_id","sale_order"."intercompany_transfer_id" as "intercompany_transfer_id","sale_order"."external_shop_do_auto_create_invoice" as "external_shop_do_auto_create_invo

Avatar
Discard

Do you have nginx/apace configured?

Author

nginx is configured see config below

Author

we alreay tried your nginx settings but still same problem.

sometimes now we see errors like:

/web/dataset/call_kw/product.pricelist.item/read: Invalid JSON data: 'nrpc":"2.0","method":"call","params":{"args":[[9931049],["order_id"....

if users work by direct odoo access http://XX.XX.XX.XX:8089 it workjs without any errors.

Author

full error Message:

nrpc":"2.0","method":"call","params":{"args":[[9931049],["order_id","order_date_ref","invoice_date","invoice_ids","product_id","name","order_partner_id","product_uom_qty","product_uom","vk_price","discount_one","discount_two","price_unit","price_subtotal","contribution_margin","sale_price_ref"]],"model":"sale.order.line","method":"read","kwargs":{"context":{"tz":"Europe/Vienna","lang":"de_DE","uid":134}}},"id":113049970}e_end","fixed_price","brutto_price","price_info","product_id","applied_on","customer_id","supplier_id","condition_group_id","group_cond","article_cond","main_price"]],"model":"product.pricelist.item","method":"read","kwargs":{"context":{"tz":"Europe/Vienna","lang":"de_DE","uid":134,"default_product_id":388802,"default_applied_on":"0_product_variant","default_compute_price":"fixed"}}},"id":831912066}

Author

/web/dataset/call_kw/product.pricelist.item/read: Invalid JSON data: 'nrpc":"2.0","method":"call","params":{"args":[[9931049],["order_id","order_date_ref","invoice_date","invoice_ids","product_id","name","order_partner_id","product_uom_qty","product_uom","vk_price","discount_one","discount_two","price_unit","price_subtotal","contribution_margin","sale_price_ref"]],"model":"sale.order.line","method":"read","kwargs":{"context":{"tz":"Europe/Vienna","lang":"de_DE","uid":134}}},"id":113049970}e_end","fixed_price","brutto_price","price_info","product_id","applied_on","customer_id","supplier_id","condition_group_id","group_cond","article_cond","main_price"]],"model":"product.pricelist.item","method":"read","kwargs":{"context":{"tz":"Europe/Vienna","lang":"de_DE","uid":134,"default_product_id":388802,"default_applied_on":"0_product_variant","default_compute_price":"fixed"}}},"id":831912066}'

Best Answer

Try the following configuration in nginx:

    location / {
proxy_pass http://odoo;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_buffer_size 128k;
proxy_buffers 16 64k;
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
send_timeout 3600;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
client_body_buffer_size 100;
location ~* /web/static {
proxy_cache_valid 200 302 60m;
proxy_cache_valid 404 1m;
proxy_buffering off;
expires 864000;
proxy_pass http://odoo;
}
location /longpolling {
proxy_pass proxy_pass http://odoo-chat;
}
}


Avatar
Discard
Author Best Answer

yes we have nginx with following config:

upstream odoo {

 server 127.0.0.1:8069;

}


upstream odoo-chat {

 server 127.0.0.1:8072;

}


server {

    server_name odoo.example.com;

    return 301 https://erp.XXX.at$request_uri;

}


server {

   listen 443 ssl http2;

   server_name erp.XXX.at;


   ssl_certificate /etc/ssl/XXX/241583318.crt;

   ssl_certificate_key /etc/ssl/XXX/server.key;

   ssl_session_timeout 1d;

   ssl_session_cache shared:SSL:50m;

   ssl_session_tickets off;


   #ssl_dhparam /path/to/dhparam.pem;


   ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

   ssl_ciphers 'XXXXXXXXXXX;

   ssl_prefer_server_ciphers on;


   add_header Strict-Transport-Security max-age=15768000;


   ssl_stapling on;

   ssl_stapling_verify on;

   ssl_trusted_certificate /etc/ssl/XXX/SectigoRSADomainValidationSecureServerCA.crt;

   resolver 8.8.8.8 8.8.4.4;


   access_log /var/log/nginx/odoo.access.log;

   error_log /var/log/nginx/odoo.error.log;


   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;


   location / {

     proxy_redirect off;

     proxy_pass http://odoo;

   }


   location /longpolling {

       proxy_pass http://odoo-chat;

   }


   location ~* /web/static/ {

       proxy_cache_valid 200 90m;

       proxy_buffering    on;

       expires 864000;

       proxy_pass http://odoo;

  }

  

location ~ /web/database/(manager|selector) {

auth_basic "Restricted Access";

auth_basic_user_file /etc/nginx/.htpasswd; 

proxy_pass http://odoo;

}

  


  # gzip

  gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;

  gzip on;

}

Avatar
Discard