This question has been flagged
3 Replies
12082 Views

 Hi Community,

I get this "500 Internal Server Error", can anyone please help to find out how to solve this issue ?
Thanks
 

Odoo

Odoo Server Error

Traceback (most recent call last):
  File "/opt/odoo/odoo/openerp/http.py", line 539, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo/openerp/http.py", line 576, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo/openerp/http.py", line 312, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo/openerp/http.py", line 309, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/odoo/odoo/openerp/http.py", line 805, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo/openerp/http.py", line 405, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo/addons/web/controllers/main.py", line 944, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/odoo/addons/web/controllers/main.py", line 936, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/werkzeug/local.py", line 338, in __getattr__
    return getattr(self._get_current_object(), name)
  File "/opt/odoo/odoo/openerp/http.py", line 248, in cr
    self._cr = self.registry.cursor()
  File "/opt/odoo/odoo/openerp/modules/registry.py", line 272, in cursor
    return self._db.cursor()
  File "/opt/odoo/odoo/openerp/sql_db.py", line 609, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
  File "/opt/odoo/odoo/openerp/sql_db.py", line 181, in __init__
    self._cnx = pool.borrow(dsn)
  File "/opt/odoo/odoo/openerp/sql_db.py", line 498, in _locked
    return fun(self, *args, **kwargs)
  File "/opt/odoo/odoo/openerp/sql_db.py", line 560, in borrow
    result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
  File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 179, in connect
    connection_factory=connection_factory, async=async)
OperationalError: FATAL:  remaining connection slots are reserved for non-replication superuser connections
Avatar
Discard
Best Answer

The problem is on your postgres max_connections limit... You need to increase that value and restart the server. It'll work.

If you are on Ubuntu: /etc/postgresql/9.x/main/postgresql.conf

Avatar
Discard
Best Answer

For now just restart your PostgreSQL which will close the all active connection 
For permanent solution You either need to increase the max_connections

 configuration setting or (probably better)  use connection polling  (PgBouncer and Pgpool) to route a large number of user requests through a smaller connection pool.

Avatar
Discard
Author Best Answer

Hi Guys,

thank you for your reply. I'm running odoo on Ubuntu server in the cloud: 2 GB Memory / 2 CPUs / 40 GB SSD Disk. We are 10 users.

I have edit default installation postgresql.conf file as follow and this has generated the problem:

max_connections = 15

shared_buffers = 512MB

effective_cache_size = 1024MB

checkpoint_segments = 10

checkpoint_completion_target = 0.9

work_mem = 8MB

maintenance_work_mem = 32MB 

I will now change max_connections to 30 and let me ask you, the other configuration you see above do you think they are correct ?

Thank you


Avatar
Discard

According to the forum guidelines please do not add another question in the answer section but please post a new question.