Some bugs have BugMessage records with no corresponding MessageChunk records

Bug #365092 reported by Eleanor Berger on 2009-04-22
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
High
Unassigned

Bug Description

See bug #365044

After introducing message hiding, we discovered that some bug messages don't have any chunks associated with them. That's strange, since foreign key constraints are supposed to ensure that this doesn't happen.

This bug is for figuring out how that could have happened and fixing if necessary.

For example, message id 3839546 / bug id 359518

This is caused by an e-mail being sent to Launchpad containing only headers, no body.

Changed in malone:
importance: Undecided → Medium
milestone: none → 2.2.4
status: New → Triaged
tags: added: oops
description: updated
tags: added: email
Changed in malone:
milestone: 2.2.4 → 2.2.5
Changed in malone:
milestone: 2.2.5 → 2.2.6
Changed in malone:
milestone: 2.2.6 → 2.2.7

On Wed, Apr 22, 2009 at 8:23 PM, Tom Berger<email address hidden> wrote:

> After introducing message hiding, we discovered that some bug messages
> don't have any chunks associated with them. That's strange, since
> foreign key constraints are supposed to ensure that this doesn't happen.

The constraints guarantee a BugMessage links to a Message. There are
no constraints guaranteeing a Message has at least one MessageChunk.

--
Stuart Bishop <email address hidden>
http://www.stuartbishop.net/

Changed in malone:
milestone: 2.2.7 → 2.2.8
Deryck Hodge (deryck) on 2009-08-28
Changed in malone:
importance: Medium → Low
milestone: 2.2.8 → none
Curtis Hovey (sinzui) on 2009-10-09
tags: added: tech-debt
Gavin Panella (allenap) wrote :

This is now causing OOPS-1552EB36.

Changed in malone:
importance: Low → High
Changed in launchpad:
importance: High → Critical
Abel Deuring (adeuring) wrote :

We should consider to add constraints ensuring that each message
has at least one MessageChunk, but I am not 100% sure about bad
side effects. Aside form the OOPS described here we also have
bug 674759. While this bug is not as serious as this one, it is
at least annoying for the LOSAs.

Note that including the empty message causing this OOPS in
the result returned by
lp.bugs.browser.bugcomment.build_comments_from_chunks() would
have another bad side effect: The comment index, as used in
the last path element of bug comment URLs like
https://bugs.launchpad.net/ubuntu/+source/compiz-fusion-plugins-main/+bug/183685/comments/497
is the index of a comment in the list returned by
build_comments_from_chunks(). If the function would include
empty comments/messages, we might change a considerable number
of URLs.

Attached is a DB patch that should ensure that each bug message
has at least one MessageChunk.

Adding this constraint would not fix this bug, but it would help us
figure out how/where the empty messages are created.

A possible candidate is lp.bugs.browser.bugmessage.BugMessageAddFormView:
The method save_action() _can_ create messages that reference
a bug watch but are otherwise empty. But the template containing
the HTML form used by this class does not contain a field for
bug watches...

Robert Collins (lifeless) wrote :

I've downgraded this because we're not actually having bugs because of it.

I don't have a particular opinion about whether we should require chunks or not, but if anything I'd say we should remove bugmessages without content.

tags: removed: oops tech-debt
Changed in launchpad:
importance: Critical → High
Robert Collins (lifeless) wrote :

Message indices are now assigned once and stored in the DB, so they will be stable.

Robert Collins (lifeless) wrote :

A left join should let us deal with the DB structure as is, unless we believe that 0-length bodies are impossible ;)

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

Other bug subscribers