accessing message 0 of bug 371281 gives wrong return type of IMessage

Bug #394097 reported by Andreas Moog
34
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Gavin Panella

Bug Description

The following code produces a "500 Internal Server Error":

>>> bug = launchpad.bugs[371281]
>>> try:
... print bug.messages[0]
... except HTTPError as error:
... print error.content
...
NoCanonicalUrl
>>>

I had a chat with thumper, who analyzed the problem:

<Ampelbein> hi there. Trying to access message 0 of bug 371281 on staging and edge gives me a "500 Internal Server Error" with the content "NoCanonicalUrl": http://paste.ubuntu.com/207250/ Is there something wrong with my code?
<Ampelbein> via python-launchpadlib that is
* thumper looks for Ampelbein
<thumper> Ampelbein: my guess is "it's a bug"
<thumper> Ampelbein: the return type of the messages is "IMessage" which doesn't have a defined url
<thumper> Ampelbein: it should really be something like "IBugMessage" which has a location (permalink)

Related branches

affects: launchpad → malone
tags: added: api oops
Revision history for this message
Gavin Panella (allenap) wrote :

OOPS-1371EB1331 seems to be an example of this.

Deryck Hodge (deryck)
Changed in malone:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Ursula Junque (ursinha) wrote :

We had a bunch of occurrences of this in 10/30, about 470. Examples: OOPS-1399EA678, OOPS-1399EA55. Probably someone running a script and hitting this bug.

Deryck Hodge (deryck)
tags: added: bug-page
Revision history for this message
Ursula Junque (ursinha) wrote :

We had 537 occurences on 11/01 and 489 on 11/02. Maybe this is a release-critical candidate?

Gavin Panella (allenap)
Changed in malone:
assignee: nobody → Gavin Panella (allenap)
Revision history for this message
Deryck Hodge (deryck) wrote :

This could be a dupe of Bug #279561. I'll leave this as the main bug on the current milestone until we know for sure and since it's more recent.

Changed in malone:
milestone: none → 3.1.11
Revision history for this message
Gavin Panella (allenap) wrote :

This may be related to or a duplicate of bug #279561.

Graham Binns (gmb)
Changed in malone:
status: Triaged → In Progress
Revision history for this message
Gavin Panella (allenap) wrote :

The root cause is messages in the Bug.indexed_messages collection that point to a parent message that is not in the collection. The API machinery tries to calculate a canonical URL for the message, but cannot do so because it has not been wrapped in the IndexedMessage delegate. The API machinery seems to cope fine when the parent is a member of the bug messages collection; presumably there's a cache or something similar at work there.

Now that we know the root cause, it's apparent that this bug is a duplicate of bug #279561. However, as a branch has been linked here, and activity is happening around this bug, I have marked the older bug a duplicate of this one.

Revision history for this message
Diogo Matsubara (matsubara) wrote : Bug fixed by a commit
Changed in malone:
status: In Progress → Fix Committed
Gavin Panella (allenap)
Changed in malone:
status: Fix Committed → Fix Released
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.