search new modules - constraint violation ir_model_data_module_name_uniq

Bug #531452 reported by Ferdinand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Invalid
Medium
Unassigned

Bug Description

branch-server 1992

trying to search for new modules I get the (little helpful) message.

IMHO uniqu check must return the value which causes the vialotaion - if not no chance to track down the problem

Last revision No. & ID : 1992 <email address hidden>

Exception in call: Traceback (most recent call last):
  File "/home/terp/OpenERP/branch/server/5.0/bin/wizard/__init__.py", line 73, in execute_cr
    action_res = action(self, cr, uid, data, context)
  File "/home/terp/OpenERP/branch/server/5.0/bin/addons/base/module/wizard/wizard_update_module.py", line 50, in _update_module
    update, add = pooler.get_pool(cr.dbname).get('ir.module.module').update_list(cr, uid)
  File "/home/terp/OpenERP/branch/server/5.0/bin/addons/base/module/module.py", line 335, in update_list
    'certificate': terp.get('certificate') or None,
  File "/home/terp/OpenERP/branch/server/5.0/bin/addons/base/module/module.py", line 500, in create
    'noupdate': True,
  File "/home/terp/OpenERP/branch/server/5.0/bin/osv/orm.py", line 2741, in create
    cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
  File "/home/terp/OpenERP/branch/server/5.0/bin/sql_db.py", line 76, in wrapper
    return f(self, *args, **kwargs)
  File "/home/terp/OpenERP/branch/server/5.0/bin/sql_db.py", line 125, in execute
    res = self._obj.execute(query, params)
IntegrityError: duplicate key value violates unique constraint "ir_model_data_module_name_uniq"

Revision history for this message
Ferdinand (office-chricar) wrote :

after droping the index

alter table ir_model_data drop constraint ir_model_data_module_name_uniq ;
the problem was this

select name,module,count(*) from ir_model_data group by name,module having count(1)>1
;
          name | module | count
-------------------------+-------------------+-------
 module_meta_information | report_openoffice | 2

./base/module/module.py: 'name': 'module_meta_information',

Changed in openobject-server:
milestone: none → 5.0.8
Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Ferdinand,

   Can you please mention the steps that you followed to produce the error?

Thanks.

Changed in openobject-server:
status: New → Incomplete
Revision history for this message
Ferdinand (office-chricar) wrote :

I wanted to re-install report_openoffice which I have uninstalled before

Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Ferdinand,

      I tried the same i installed a module uninstalled it and then tried to reinstall it but was unable to produce the error. I also tried the same with other machines but was still unable to produce the error. Can you please give us the steps that you followed when you got this error.

Thank you.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Dr. Ferdinand,
Looking at the traceback, it suggests me that the line numbers of latest code collide with the traceback.
Make sure you have updated the code.
Please, reopen the bug when you get the error with latest revisions.

It was fixed few weeks ago when similar issue was raised when you delete a module and do update modules list.
Thanks.

Changed in openobject-server:
status: Incomplete → Invalid
Changed in openobject-server:
importance: Undecided → Medium
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.