IntegrityError raised deleting a series

Bug #899123 reported by Diogo Matsubara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Steve Kowalik

Bug Description

OOPS-93c9602da4a55064c5b25f5db810f54b IntegrityError: update or delete on table "milestone" violates foreign key constraint "bugtask__product__milestone__fk" on table "bugtask"
DETAIL: Key (product,id)=(28142,35309) is still referenced from table "bugtask".

Raised deleting this series: https://launchpad.net/akiban-tools/halo/+delete

Related branches

Curtis Hovey (sinzui)
tags: added: bugs milestones series
Revision history for this message
Curtis Hovey (sinzui) wrote :

I wonder if there is another bug relationship that the delete rules are not aware of. The milestone is removed from the bugs before the milestone is deleted. The code even knows that conjoined masters need to be deleted.

    def _deleteMilestone(self, milestone):
        """Delete a milestone and unlink related objects."""
        self._unsubscribe_structure(milestone)
        for bugtask in self._getBugtasks(milestone):
            if bugtask.conjoined_master is not None:
                Store.of(bugtask).remove(bugtask.conjoined_master)
            else:
                bugtask.milestone = None
        for spec in self._getSpecifications(milestone):
            spec.milestone = None
        self._deleteRelease(milestone.product_release)
        milestone.destroySelf()

Revision history for this message
Steve Kowalik (stevenk) wrote :

I don't think there is another bug relationship. The _getBugtasks() method limits the bugtasks returned to ones the user can see by using BugTaskSearchParams(user=self.user) -- if there are other bugtasks with the milestone set, the OOPS as seen will be raised.

Curtis Hovey (sinzui)
Changed in launchpad:
assignee: nobody → Steve Kowalik (stevenk)
status: Triaged → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
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.