OpenERP 6.1 stops working after postgresql restart

Bug #1153815 reported by Oleg Kuryan
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
OpenERP Publisher's Warranty Team

Bug Description

That problem is rather critical for us, cause it affects production environment. That problem occurs time to time and may lead to serious delays in the work, cause OpenERP becomes unusable until somebody restarts it.

We're using OpenERP version 6.1-20121129-003502 on Ubuntu 12 server. PostgreSQL 9.1

Steps to reproduce are the following:
1) Login to some OpenERP database and logout
2) Now stop postgresql server (/etc/init.d/postgresql stop)
3) Try to login to the same database
4) You got Error message - that is OK
5) Now start postgresql service (/etc/init.d/postgresql start)
6) Now try to log into same database again and see error message shown at the end of the ticket description
Only restart of OpenERP server helps

Expected behavior:
 - OpenERP should automatically clear broken connections from pool and try to reconnect to DB Server

Additional problems:
- We're using 2 servers - one for OpenERP and second for PostgreSQL database. So it is not easy for us to write script that will restart OpenERP just after PostgreSQL restart. And obviously that problem need to be solved from OpenERP side.

-------------------Error message ------------------------
"/opt/expansaerp/server/openerp/addons/web/controllers/main.py", line 498, in authenticate
    req.session.authenticate(db, login, password, env)
  File "/opt/expansaerp/server/openerp/addons/web/common/session.py", line 73, in authenticate
    uid = self.proxy('common').authenticate(db, login, password, env)
  File "/opt/expansaerp/server/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/opt/expansaerp/server/openerp/addons/web/common/http.py", line 608, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)

Server Traceback (most recent call last):
  File "/opt/expansaerp/server/openerp/addons/web/common/http.py", line 593, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/expansaerp/server/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/expansaerp/server/openerp/service/web_services.py", line 397, in dispatch
    return fn(*params)
  File "/opt/expansaerp/server/openerp/service/web_services.py", line 409, in exp_authenticate
    return res_users.authenticate(db, login, password, user_agent_env)
  File "/opt/expansaerp/server/openerp/addons/base/res/res_users.py", line 459, in authenticate
    uid = self.login(db, login, password)
  File "/opt/expansaerp/server/openerp/addons/base/res/res_users.py", line 478, in login
    cr = pooler.get_db(db).cursor()
  File "/opt/expansaerp/server/openerp/sql_db.py", line 465, in cursor
    return Cursor(self._pool, self.dbname, serialized=serialized)
  File "/opt/expansaerp/server/openerp/sql_db.py", line 180, in __init__
    self.autocommit(False)
  File "/opt/expansaerp/server/openerp/sql_db.py", line 152, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/expansaerp/server/openerp/sql_db.py", line 325, in autocommit
    self._cnx.set_isolation_level(isolation_level)
OperationalError: no connection to the server

Tags: maintenance
Changed in openobject-server:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Philipp Noack (philipp-noack-b) wrote :

Same here, the only workaround is to restart openerp by hand. But that might not always be possible, e.g. when there is an unattended upgrade of postgres at night.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.