KeyError: 'serialization_field_id'

Bug #908069 reported by kurt
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

Server Traceback (most recent call last):
  File "/srv/openerp/server/openerp/wsgi.py", line 77, in xmlrpc_return
    result = openerp.netsvc.dispatch_rpc(service, method, params)
  File "/srv/openerp/server/openerp/netsvc.py", line 325, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/srv/openerp/server/openerp/service/web_services.py", line 387, in dispatch
    return fn(*params)
  File "/srv/openerp/server/openerp/service/web_services.py", line 398, in exp_authenticate
    res_users = pooler.get_pool(db).get('res.users')
  File "/srv/openerp/server/openerp/pooler.py", line 50, in get_pool
    return get_db_and_pool(db_name, force_demo, status, update_module)[1]
  File "/srv/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
  File "/srv/openerp/server/openerp/modules/registry.py", line 138, in get
    update_module, pooljobs)
  File "/srv/openerp/server/openerp/modules/registry.py", line 160, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/srv/openerp/server/openerp/modules/loading.py", line 299, in load_modules
    loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report)
  File "/srv/openerp/server/openerp/modules/loading.py", line 171, in load_module_graph
    init_module_models(cr, package.name, models)
  File "/srv/openerp/server/openerp/modules/module.py", line 287, in init_module_models
    result = obj._auto_init(cr, {'module': module_name})
  File "/srv/openerp/server/openerp/osv/orm.py", line 2747, in _auto_init
    self._field_create(cr, context=context)
  File "/srv/openerp/server/openerp/osv/orm.py", line 817, in _field_create
    if cols[k][key] != vals[key]:
KeyError: 'serialization_field_id'

OpenERP Server 6.1

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello Kurt,

I have checked your issue but I did not face problem so
would you please give me a information where you face the
problem and please write some description so we can
qualify issue.

Thanks and waiting for replay!

Changed in openobject-server:
status: New → Incomplete
Revision history for this message
kurt (kurt-catsanddogs) wrote :

I got this error after I got the newest revisions of 'addons / web / server'

Then I started the server with the '-u all' parameter to update the addons and
when I try to logon in OpenERP, I got this error.

When debugging this I noticed a new entry in the column definition of
'ir.model.fields' -> serialization_field_id.
But in orm.py OpenERP was trying to access that field, but it didn't
exist in the table.

A dirty fix:
I removed all 'serialization_field_id' entries in orm.py restarted the server so OpenERP could add
the column in 'ir.model.fields'. Then I restored the orm.py to the original state and restarted the
server without any error.

RevNo OpenERP Server : 3918

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hello,

This is because a new field has been added to the ir.model.fields table in trunk. But because this table is at the very heart of the system, its columns are being accessed even during the time it takes to update its structure (when starting with -u all).
Therefore this requires a manual migration step, in the form of a quick SQL update when upgrading an existing trunk database:

  ALTER TABLE ir_model_fields ADD column serialization_field_id int references ir_model_fields on delete cascade;

I'll see if there's a way to avoid this manual step, but otherwise we can simply consider this a necessary migration step.

Thanks for reporting and for your understanding!

Changed in openobject-server:
status: Incomplete → Invalid
Revision history for this message
ange bouabre (angebouabre) wrote :

@Olivier Dony, I'm french student and i try to learn openerp. I met the same problem but i don't know where i must execute your command: ALTER TABLE ir_model_fields ADD column serialization_field_id int references ir_model_fields on delete cascade;

Waiting your answer Please.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: [Bug 908069] Re: KeyError: 'serialization_field_id'

Hello,

On 04/24/2012 10:59 AM, ange bouabre wrote:
> @Olivier Dony, I'm french student and i try to learn openerp. I met the
> same problem but i don't know where i must execute your command: ALTER
> TABLE ir_model_fields ADD column serialization_field_id int references
> ir_model_fields on delete cascade;

If you're simply trying to learn OpenERP, then the simplest method to avoid
this error is to start again with a new database, and delete your old ones.

Migrations from major versions of OpenERP to the next (e.g. 6.0 to 6.1) cannot
be accomplished without going through a specific migration procedure, which
requires you to purchase an OpenERP Enterprise Contract. I don't suppose it
would make sense for you, so the easiest would really be to create a new database.

If you want really want to execute the fix I described above you need to use a
Postgresql client like PGAdmin (it usually comes with PostgreSQL), then find
the credentials to login on your OpenERP database, and finally execute the SQL
command I mentioned. But this is quite technical and it will only solve this
particular migration issue, while you will potentially encounter dozens more.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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