Odoo Help

2

odoo FATAL: sorry, too many clients already

By
Baintex Technologies S.L.
on 5/16/18, 9:30 AM 1,101 views

I have Odoo 9 with postgreSQL 9.6, with nginx and the longpolling well configured.

Everything is working fine, and suddenly, the server crashes and this message appears in the log:

OperationalError: FATAL:  sorry, too many clients already
2018-05-16 13:00:02,496 141 INFO ? openerp.sql_db: Connection to the database failed
2018-05-16 13:00:02,496 141 ERROR ? openerp.service.server: Worker (141) Exception occured, exiting...
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/openerp/service/server.py", line 721, in run
    self.process_work()
  File "/usr/lib/python2.7/dist-packages/openerp/service/server.py", line 790, in process_work
    db_names = self._db_list()
  File "/usr/lib/python2.7/dist-packages/openerp/service/server.py", line 783, in _db_list
    db_names = openerp.service.db.list_dbs(True)
  File "/usr/lib/python2.7/dist-packages/openerp/service/db.py", line 323, in list_dbs
    with closing(db.cursor()) as cr:
  File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 643, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
  File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 177, in __init__
    self._cnx = pool.borrow(dsn)
  File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 526, in _locked
    return fun(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 594, in borrow
    **connection_info)
  File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)


I have to restart the server to temporal fix, but I don't know what is the cause.

I have a 4 cores CPU with 8 GB RAM.

I set these parameters in Odoo.conf file:

...
workers = 7
max_cron_threads = 2
db_maxconn = 64

What is the reason of the crash? Is it an odoo config error or a postgreSQL config error?


We're suffering from a similair problem, only when running the scheduler. It seems like Odoo is keeping the connections "alive" (even though they might be idle) for well over 2 days. This might be the cause.

21south, Ludo - 21South
on 5/16/18, 10:12 AM

21south, Ludo - 21South

Do you have a better solution than set workers to 0?

Nacho
on 5/17/18, 3:17 AM
Qué me envías?







   



2018-05-17 9:18 GMT+02:00 Nacho <nacho@baintex.com>:

21south, Ludo - 21South

Do you have a better solution than set workers to 0?

--
Nacho

Sent by Odoo S.A. using Odoo.


Baintex Technologies S.L.
on 5/17/18, 4:26 AM

check postgres and system logs. you will surely find something. monitor how many idle users you have hanging in postgres so on. can't say much by looking at that log

Fatih Piristine
on 5/17/18, 9:14 PM
1
Rafael Portilla
On 5/17/18, 4:47 PM

Try to check your postgres config

(ex:/etc/postgresql/9.5/main/postgresql.conf in ubuntu) in max_connections 

maybe you have some other connections to your database, not just from odoo, and you need to increase it. 



There is 100 max_connections in postgresql.conf file.

There are 8 instances of odoo connecting to the database.

I have set db_maxconn = 10 instead of 64 and now it works fine and it does not crash.

Nacho
on 5/22/18, 9:48 AM
0

Hilar AK

--Hilar AK--
--Hilar AK--
  Blog:-
        https://hilarlive.wordpress.com/
  StackOverflow:
        http://stackoverflow.com/users/7561347/burmese-pythis

Quora:
    

            https://www.quora.com/profile/Hilar-Ak-1

Experienced Odoo developer, Functional Consultant. Happy to help in the development and also functional consultation.



Hilar AK
On 5/16/18, 10:14 AM

Here is the link which helps for worker calculations. so you can deploy odoo correctly. Have a look here maybe helps

https://www.odoo.com/documentation/10.0/setup/deploy.html#worker-number-calculation

I know this page but I don't know what is the problem with my configuration.

I put 7 workers and 2 max_cron_threads.

Why is the server crashing after a period of short time (less than a day)?

Baintex Technologies S.L.
on 5/16/18, 10:26 AM
Can you please ask the same question here <technical@mail.odoo.com>

On Wed, May 16, 2018 at 7:57 PM, Baintex Technologies S.L. <mariajose@baintex.com> wrote:

I know this page but I don't know what is the problem with my configuration.

I put 7 workers and 2 max_cron_threads.

Why is the server crashing after a period of short time (less than a day)?

--
Baintex Technologies S.L.

Sent by Odoo S.A. using Odoo.




--
Hilar AK  Python / Odoo Developer

m: +917736617619
e: hilarak@gmail.com
Follow me:
twitteryoutubegithubstack-overflow


Hilar AK
on 5/16/18, 10:33 AM

I have tried to send an email at that address and I only receive this automatic mail:

Invalid response code from remote server: 5

Final-Recipient: rfc822; technical@mail.odoo.com

Action: failed

Status: 4.5.0

Remote-MTA: dns; ob3.odoo.com. (137.74.205.210, the server for the domain mail.odoo.com.)

Diagnostic-Code: smtp; Invalid response code from remote server: 5 5 0 5 . 7 . 1 M a i l b o x u n a v a i l a b l e - M a i l b o x u n a v a i l a b l e - a l i a s t e c h n i c a l : r e s t r i c t e d t o c h a n n e l m e m b e r s

Last-Attempt-Date: Sat, 19 May 2018 10:18:43 -0700 (PDT)

Nacho
on 5/22/18, 9:51 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 5/16/18, 9:30 AM
Seen: 1101 times
Last updated: 5/22/18, 9:48 AM