If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

MindTouch feed breaks Django profile page for some users

RESOLVED FIXED in 2.1

Status

Mozilla Developer Network
Wiki pages
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: lorchard, Assigned: lorchard)

Tracking

unspecified
x86
Mac OS X

Details

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

(Assignee)

Description

6 years ago
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'
(Assignee)

Comment 1

6 years ago
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.
(Assignee)

Updated

6 years ago
Target Milestone: --- → 2.1
Whiteboard: u=user c=profiles p=
Whiteboard: u=user c=profiles p= → u=user c=profiles p=2
(Assignee)

Comment 2

6 years ago
Going to take a crack at this
Assignee: nobody → lorchard
(Assignee)

Comment 3

6 years ago
https://github.com/mozilla/kuma/pull/88

Comment 4

6 years ago
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
Last Resolved: 6 years ago
Resolution: --- → FIXED
Version: MDN → unspecified
Component: Website → Landing pages
Product: Mozilla Developer Network → Mozilla Developer Network
You need to log in before you can comment on or make changes to this bug.