Closed Bug 715923 Opened 12 years ago Closed 12 years ago

MindTouch feed breaks Django profile page for some users

Categories

(developer.mozilla.org Graveyard :: Wiki pages, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lorchard, Assigned: lorchard)

Details

(Whiteboard: u=user c=profiles p=2)

Seeing a bunch of server errors for users that look like this:

Traceback (most recent call last):

  File "/data/www/django/developer.mozilla.org/kuma/vendor/src/django/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/django/developer.mozilla.org/kuma/apps/devmo/views.py", line 63, in profile_view
    docs_feed_items = (UserDocsActivityFeed(user.username)

  File "/data/www/django/developer.mozilla.org/kuma/apps/devmo/models.py", line 262, in items
    parser.parseString(data)

  File "/data/www/django/developer.mozilla.org/kuma/apps/devmo/models.py", line 294, in parseString
    xml.sax.parseString(data, self, self.error)

  File "/usr/lib/python2.6/xml/sax/__init__.py", line 49, in parseString
    parser.parse(inpsrc)

  File "/usr/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)

  File "/usr/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)

  File "/usr/lib/python2.6/xml/sax/expatreader.py", line 211, in feed
    self._err_handler.fatalError(exc)

AttributeError: 'function' object has no attribute 'fatalError'
This bug seems transient, as many things MindTouch are. It's caused by a bad result from an HTTP GET of an activity feed like this:

    https://developer.mozilla.org/@api/deki/users/=end3r/feed?format=raw

The bad result can be either HTML (eg. 503 Service Temporarily Unavailable) or just empty content. Either way, an uncaught XML parsing error occurs. The problem is exacerbated by caching, which prolongs the effect of the bad result from MindTouch.

The best practical fix for this bug is to make the feed handling on Django profiles more robust. Catch any parsing exceptions and, at worst, just display an empty feed until MindTouch recovers. It might be best to leave the invalid MindTouch response cached, though, rather than hammer MindTouch until a valid response is found.
Target Milestone: --- → 2.1
Whiteboard: u=user c=profiles p=
Whiteboard: u=user c=profiles p= → u=user c=profiles p=2
Going to take a crack at this
Assignee: nobody → lorchard
Commit pushed to https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/ded3f81e4451cfaf927e88ebcaf21f8efd5e8204
Merge pull request #88 from lmorchard/bug-715923-profile-feed-errors

Bug 715923 profile feed errors
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Version: MDN → unspecified
Component: Website → Landing pages
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.