Autovacuum causes integrity errors in portal_wizard/portal_wizard_user deletion

Bug #1135601 reported by Marcel van der Boom (HS-Development BV)
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP R&D Addons Team 1

Bug Description

The autovacuum job in 7.0 which removes transient objects tries to remove records from portal_wizard with a statement like:

  delete from portal_wizard where id in (1,2,3)

This statement fails because it tries to set the field wizard_id to NULL in portal_wizard_user which is defined as not null

The effect is that the objects are never pruned.

Solution is either to allow null in the wizard_id field or do a cascade.

Related branches

Revision history for this message
Marcel van der Boom (HS-Development BV) (mrb) wrote :

Another solution would be to delete the portal.wizard.user objects first, but I don't know if the order of objects can be specified for the autovacuum job

Revision history for this message
Amit Parik (amit-parik) wrote :

Fixes looks like correct, our core team will review it.

Thank you!

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
Marcel van der Boom (HS-Development BV) (mrb) wrote :

Can this be merge please? Fix is trivial.

Revision history for this message
Landis (larnold) wrote :

I am getting this error also. Can't find he root. Has been ongoing.

___________

delete from portal_wizard where id IN (1,2,3,4,5)

Traceback (most recent call last): File"...openerp/server/openerp/sql)db.py", line 226, in execute res = self._obj.execute(query,params) IntegrityError: null value in column "wizard_id" violates not-null constraint CONTEXT: SQL statement "UPDATE ONLY "public"."portal_wizard_user" SET "wizard_id" = NULL WHRE $1 OPERATOR(pg_catalog.=) "wizard id"

(see attached screen shot of latest Traceback)

?field.comment=I am getting this error also. Can't find he root

delete from portal_wizard where id IN (1,2,3,4,5)

Traceback (most recent call last): File"...openerp/server/openerp/sql)db.py", line 226, in execute res = self._obj.execute(query,params) IntegrityError: null value in column "wizard_id" violates not-null constraint CONTEXT: SQL statement "UPDATE ONLY "public"."portal_wizard_user" SET "wizard_id" = NULL WHRE $1 OPERATOR(pg_catalog.=) "wizard id"

(see attached screen shot of latest Traceback)

Revision history for this message
Marcel van der Boom (HS-Development BV) (mrb) wrote :

Landis,

The cause of this bug is that the database needs an 'on delete cascade' clause for a column (see the diff at the top of this bug report).
If you apply the patch manually the error will disappear.

I do not know why this has not been applied, it's trivial.

Can anyone from OpenERP comment on this?

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.