← Back to team overview

openupgrade-drivers team mailing list archive

Re: [Question #247140]: OpenERP 6.1 to 7.0 upgrade gives database IntegrityError

 

Question #247140 on OpenUpgrade Server changed:
https://answers.launchpad.net/openupgrade-server/+question/247140

Description changed to:
Hi, everybody

I'm trying to upgrade at least the main module of my Openerp database from OpenERP 6.1.1 to OpenERP7.
I've tried to both use the migrate.py script and using openerp-server in place migration. 
Here are the commands used:
For migrate.py:
sudo -u openerp python migrate.py --config=/etc/openerp-server/openerp.conf --database=cyssea_international -R 7.0 
For openerp-server:
sudo -u openerp /var/tmp/openupgrade/7.0/server/openerp-server --config=/etc/openerp-server/openerp.conf --update=base --addons-path=/var/tmp/openupgrade/7.0/addons/  --logfile=/var/tmp/openupgrade/migration.log  --stop-after-init -d cyssea_international --debug


Here is the error itself, the same in both cases:
2014-04-17 14:03:25,508 4247 WARNING cyssea_international openerp.osv.orm: WARNING: unable to set column action_id of table ir_actions
_todo not null !
Try to re-run: openerp-server --update=module
If it doesn't work, update records and execute manually:
ALTER TABLE ir_actions_todo ALTER COLUMN action_id SET NOT NULL
2014-04-17 14:03:36,742 4247 ERROR cyssea_international openerp.sql_db: bad query: ALTER TABLE "ir_act_window_view" ADD FOREIGN KEY ("act_window_id") REFERENCES "ir_act_window" ON DELETE cascade
Traceback (most recent call last):
  File "/var/tmp/openupgrade/7.0/server/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
IntegrityError: insert or update on table "ir_act_window_view" violates foreign key constraint "ir_act_window_view_act_window_id_fkey"
DETAIL:  Key (act_window_id)=(5) is not present in table "ir_act_window".

2014-04-17 14:03:36,764 4247 ERROR cyssea_international openerp: Failed to initialize database `cyssea_international`.
Traceback (most recent call last):
  File "/var/tmp/openupgrade/7.0/server/openerp/cli/server.py", line 98, in preload_registry
    db, registry = openerp.pooler.get_db_and_pool(dbname,update_module=update_module)
  File "/var/tmp/openupgrade/7.0/server/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module)
  File "/var/tmp/openupgrade/7.0/server/openerp/modules/registry.py", line 192, in get
    update_module)
  File "/var/tmp/openupgrade/7.0/server/openerp/modules/registry.py", line 218, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/var/tmp/openupgrade/7.0/server/openerp/modules/loading.py", line 331, in load_modules
    loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=update_module, report=report, registry=registry)
  File "/var/tmp/openupgrade/7.0/server/openerp/modules/loading.py", line 186, in load_module_graph
    init_module_models(cr, package.name, models)
  File "/var/tmp/openupgrade/7.0/server/openerp/modules/module.py", line 381, in init_module_models
    obj._auto_end(cr, {'module': module_name})
  File "/var/tmp/openupgrade/7.0/server/openerp/osv/orm.py", line 3243, in _auto_end
    cr.execute('ALTER TABLE "%s" ADD FOREIGN KEY ("%s") REFERENCES "%s" ON DELETE %s' % (t, k, r, d))
  File "/var/tmp/openupgrade/7.0/server/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/var/tmp/openupgrade/7.0/server/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
IntegrityError: insert or update on table "ir_act_window_view" violates foreign key constraint "ir_act_window_view_act_window_id_fkey"
DETAIL:  Key (act_window_id)=(5) is not present in table "ir_act_window".

>From what I've received, there are no import errors and the required elements are in place. The element with ID = 5 is "Action Bindings" in my DB, during the upgrade it is removed, but the action is not commited. Adding the --debug option to the openerp-server script didn't add any hint to when the element  is removed.
Please help me understand what might be the cause of this error.

-- 
You received this question notification because you are a member of
OpenUpgrade Drivers, which is an answer contact for OpenUpgrade Server.