credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #05592
lp:~savoirfairelinux-openerp/openupgrade-server/OperationalError into lp:openupgrade-server
Sandy Carter (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/openupgrade-server/OperationalError into lp:openupgrade-server.
Requested reviews:
OpenUpgrade Committers (openupgrade-committers)
For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openupgrade-server/OperationalError/+merge/192740
Fixes a secondary exception when post-scripts generate an exception.
I found this to be due to openupgrade calling cr.close(), then raising the exception where OpenERP would attempt to close it again.
This generates a lot of useless exceptions which clutters the output and makes it hard to debug the proper errors.
Example:
2013-10-25 19:31:04,263 12738 ERROR upgrade openerp.modules.loading: Error executing post migration script for module base
:
2013-10-25 19:31:04,267 12738 ERROR upgrade openerp: Failed to initialize database `upgrade`.
Traceback (most recent call last):
File "parts/openerp/openerp/cli/server.py", line 98, in preload_registry
db, registry = openerp.pooler.get_db_and_pool(dbname,update_module=update_module)
File "parts/openerp/openerp/pooler.py", line 33, in get_db_and_pool
registry = RegistryManager.get(db_name, force_demo, status, update_module)
File "parts/openerp/openerp/modules/registry.py", line 192, in get
update_module)
File "parts/openerp/openerp/modules/registry.py", line 218, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File "parts/openerp/openerp/modules/loading.py", line 475, in load_modules
cr.close()
File "parts/openerp/openerp/sql_db.py", line 160, in wrapper
raise psycopg2.OperationalError(msg)
OperationalError: Unable to use a closed cursor.
--
https://code.launchpad.net/~savoirfairelinux-openerp/openupgrade-server/OperationalError/+merge/192740
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~savoirfairelinux-openerp/openupgrade-server/OperationalError into lp:openupgrade-server.
=== modified file 'openerp/modules/loading.py'
--- openerp/modules/loading.py 2013-07-31 14:31:39 +0000
+++ openerp/modules/loading.py 2013-10-25 19:37:34 +0000
@@ -234,7 +234,6 @@
migrations.migrate_module(package, 'post')
except Exception, e:
_logger.error('Error executing post migration script for module %s: %s', package, e)
- cr.close()
raise
ver = adapt_version(package.data['version'])
Follow ups