No url for <Message at ...> when trying to access bug messages through the API

Bug #279561 reported by Eleanor Berger
20
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Medium
Eleanor Berger

Bug Description

Using launchpadlib, trying:

    list(launchpad.bugs[1].messages)

results in:

HTTPError() HTTP Error 500: Internal Server Error
No url for <Message at 0x7e614d0> because <Message at 0x7e614d0> broke the chain.

Traceback (most recent call last):
  File "/srv/staging.launchpad.net/staging/launchpad/lib/zope/publisher/publish.py", line 133, in publish
    result = publication.callObject(request, obj)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/launchpad/webapp/publication.py", line 331, in callObject
    return mapply(ob, request.getPositionalArguments(), request)
  File "/srv/staging.launchpad.net/staging/launchpad/lib/zope/publisher/publish.py", line 108, in mapply
    return debug_call(obj, args)
  File "/srv/staging.launchpad.net/staging/launchpad/lib/zope/publisher/publish.py", line 114, in debug_call
    return obj(*args)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/resource.py", line 521, in __call__
    result = self.do_GET()
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/resource.py", line 1006, in do_GET
    return simplejson.dumps(result, cls=ResourceJSONEncoder)
  File "/var/lib/python-support/python2.4/simplejson/__init__.py", line 215, in dumps
    separators=separators, encoding=encoding,
  File "/var/lib/python-support/python2.4/simplejson/encoder.py", line 352, in encode
    chunks = list(self.iterencode(o))
  File "/var/lib/python-support/python2.4/simplejson/encoder.py", line 297, in _iterencode
    for chunk in self._iterencode_dict(o, markers):
  File "/var/lib/python-support/python2.4/simplejson/encoder.py", line 263, in _iterencode_dict
    for chunk in self._iterencode(value, markers):
  File "/var/lib/python-support/python2.4/simplejson/encoder.py", line 294, in _iterencode
    for chunk in self._iterencode_list(o, markers):
  File "/var/lib/python-support/python2.4/simplejson/encoder.py", line 192, in _iterencode_list
    for chunk in self._iterencode(value, markers):
  File "/var/lib/python-support/python2.4/simplejson/encoder.py", line 305, in _iterencode
    for chunk in self._iterencode_default(o, markers):
  File "/var/lib/python-support/python2.4/simplejson/encoder.py", line 311, in _iterencode_default
    newobj = self.default(o)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/resource.py", line 111, in default
    return IJSONPublishable(obj).toDataForJSON()
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/resource.py", line 614, in toDataForJSON
    repr_name, repr_value = self._unmarshallField(name, field)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/resource.py", line 758, in _unmarshallField
    repr_value = marshaller.unmarshall(self.entry, value)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/lazr/rest/marshallers.py", line 477, in unmarshall
    repr_value = canonical_url(value)
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/launchpad/webapp/publisher.py", line 370, in canonical_url
    urlparts = [urldata.path
  File "/srv/staging.launchpad.net/staging/launchpad/utilities/../lib/canonical/launchpad/webapp/publisher.py", line 325, in canonical_urldata_iterator
    raise NoCanonicalUrl(obj, current_object)
NoCanonicalUrl: No url for <Message at 0x7e614d0> because <Message at 0x7e614d0> broke the chain.

OOPSes related: OOPS-1012EA222, OOPS-1012EB156, OOPS-1012EB157, OOPS-1012EB158, OOPS-1012EB159, OOPS-1012EB160, OOPS-1012EB162, OOPS-1012EC148, OOPS-1012EC149, OOPS-1012ED155

Tags: api lp-bugs oops
Changed in malone:
assignee: nobody → intellectronica
milestone: none → 2.1.10
status: New → Triaged
Revision history for this message
Eleanor Berger (intellectronica) wrote :

This only seems to affect a small number of bugs (I still don't know what the cause is).

Revision history for this message
Eleanor Berger (intellectronica) wrote :

Here are some bugs for which there are messages affected by this problem:

          1
  17216
  22336
  40246
  59695
  65609
  69931
108091
129469
146706

Revision history for this message
Eleanor Berger (intellectronica) wrote :

Interestingly, this doesn't happen when I try to access those messages not through the API, which makes it quite a lot harder to debug.

Revision history for this message
Eleanor Berger (intellectronica) wrote :
Ursula Junque (ursinha)
description: updated
Changed in malone:
importance: Undecided → High
Revision history for this message
Eleanor Berger (intellectronica) wrote :

It looks like the reason this is happening is that when the canonical_url for the message is looked up, it doesn't appear to have any bugs associated with it.

How that happens is a mystery to me. After all, the reason that message was returned is precisely because it is associated with a bug.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

Looking at the DB confirms that there's no connection between the offending messages and any bug, so the remaining question is why they are being returned at all.

Revision history for this message
Diogo Matsubara (matsubara) wrote :

Ursula, please keep an eye on the users that generated OOPSes similar to this one. If it's Tom Berger or Markus Korn, it means they're investigating the issue. Bring up new OOPSes if they are caused by other users.

Meanwhile Tom will continue diagnosing this issue.

Thanks.

Revision history for this message
Björn Tillenius (bjornt) wrote :

Is this still an issue? The last time I saw an oops like this was October 8.

Changed in malone:
milestone: 2.1.10 → none
status: Triaged → Incomplete
Revision history for this message
Eleanor Berger (intellectronica) wrote :

This is still an issue (I can trigger it reliably) but its scope is very limited. It looks like it's the result of bad data, so it's worth investigating further, cleaning the DB and finding out why it happens.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

lowering importance since this is not a very common problem

Changed in malone:
importance: High → Low
Revision history for this message
Ursula Junque (ursinha) wrote :

I can reproduce it consistently, with bug 297169.
It OOPSes on <message at https://api.staging.launchpad.net/beta/ubuntu/+source/mozvoikko/+bug/297169/comments/15>, all other 21 comments work perfectly.

lp.load('https://api.staging.launchpad.net/beta/ubuntu/+source/mozvoikko/+bug/297169/comments/15') is enough for it to blow as HTTP Error 500: Internal Server Error.

Changed in malone:
status: Incomplete → New
Revision history for this message
Eleanor Berger (intellectronica) wrote :

This is now happening much more frequently

Changed in malone:
importance: Low → Medium
milestone: none → 2.2.1
status: New → Triaged
Revision history for this message
Eleanor Berger (intellectronica) wrote :

~leonardr theorizes that all offending messages are messages that were submitted by email. so far it seems that the data confirms this.

Revision history for this message
Leonard Richardson (leonardr) wrote :
Revision history for this message
James Westby (james-w) wrote : Re: [Bug 279561] Re: No url for <Message at ...> when trying to access bug messages through the API

On Tue, 2009-01-13 at 17:48 +0000, Leonard D. Richardson wrote:
> Here are some specific messages that have problems from the list of bad
> bugs Tom posted:
>
> https://bugs.staging.launchpad.net/acpi/+bug/22336/comments/233
> https://bugs.edge.launchpad.net/ubuntu/+source/glib2.0/+bug/40246/comments/3
> https://bugs.staging.launchpad.net/dell/+bug/59695/comments/168
> https://bugs.staging.launchpad.net/ubuntu/+source/firefox/+bug/65609/comments/37
> https://bugs.edge.launchpad.net/ubuntu/+source/firefox/+bug/69931/comments/12
> https://bugs.edge.launchpad.net/ubuntu/+source/mobile-basic-flash/+bug/129469/comments/1
> https://bugs.edge.launchpad.net/ubuntu/+source/xserver-xorg-video-nv/+bug/146706/comments/12
> https://bugs.staging.launchpad.net/beta/ubuntu/+source/hplip/+bug/108091/comments/7
>
> All these messages have one thing in common: they were created from
> email messages. Either they have the form of email messages (with
> greeting and signoff) or they have quoting and "on [date], [person]
> wrote...". Not all messages created from emails cause problems, but some
> do.
>

The error message to me suggests some problem with threading. Perhaps
the messages were sent without an "In-Reply-To:" header?

Thanks,

James

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 279561] Re: No url for <Message at ...> when trying to access bug messages through the API

On Tue, Jan 13, 2009 at 05:48:43PM -0000, Leonard D. Richardson wrote:
> All these messages have one thing in common: they were created from
> email messages.

I found another thing they have in common. They all have a datecreated
(in the DB) that is lacking the decimal part. I.e., usually messages
have a datecreated that looks like this:

    2007-04-04 11:39:32.173281

The messages that break have a datecreated that look like this:

    2007-04-04 12:35:47

Hopefully you'll be able to reproduce this bug locally, if you set a
message's datecreated manually to the latter form.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

I can't reproduce this locally by shortening datecreated, so perhaps that's not it.

Changed in malone:
milestone: 2.2.1 → 2.2.2
Revision history for this message
Eleanor Berger (intellectronica) wrote :

It seems that the offending messages have a parent which is not one of the messages for the bug. I'm not sure how that might be related.

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

Although this is the earlier bug, progress has been recorded on bug #394097 so I have marked this one as a duplicate.

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.