Page MenuHomePhabricator

Wikimetrics' cohort page is returning 500 in production {dove} [2 pts]
Closed, ResolvedPublic

Description

When the cohorts page is requested, Wikimetrics returns 500. The logs say:

[Wed Oct 07 11:02:01 2015] [error] Traceback (most recent call last):
[Wed Oct 07 11:02:01 2015] [error]   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
[Wed Oct 07 11:02:01 2015] [error]     response = self.full_dispatch_request()
[Wed Oct 07 11:02:01 2015] [error]   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
[Wed Oct 07 11:02:01 2015] [error]     rv = self.handle_user_exception(e)
[Wed Oct 07 11:02:01 2015] [error]   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
[Wed Oct 07 11:02:01 2015] [error]     reraise(exc_type, exc_value, tb)
[Wed Oct 07 11:02:01 2015] [error]   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
[Wed Oct 07 11:02:01 2015] [error]     rv = self.dispatch_request()
[Wed Oct 07 11:02:01 2015] [error]   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
[Wed Oct 07 11:02:01 2015] [error]     return self.view_functions[rule.endpoint](**req.view_args)
[Wed Oct 07 11:02:01 2015] [error]   File "/srv/wikimetrics/wikimetrics/controllers/cohorts.py", line 50, in cohorts_index
[Wed Oct 07 11:02:01 2015] [error]     return render_template('cohorts.html', tags=json.dumps(tags))
[Wed Oct 07 11:02:01 2015] [error]   File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
[Wed Oct 07 11:02:01 2015] [error]     return _default_encoder.encode(obj)
[Wed Oct 07 11:02:01 2015] [error]   File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
[Wed Oct 07 11:02:01 2015] [error]     chunks = self.iterencode(o, _one_shot=True)
[Wed Oct 07 11:02:01 2015] [error]   File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
[Wed Oct 07 11:02:01 2015] [error]     return _iterencode(o, 0)
[Wed Oct 07 11:02:01 2015] [error] UnicodeDecodeError: 'utf8' codec can't decode byte 0xd6 in position 49: unexpected end of data

It seems someone added a tag that causes problems.
T100781 fixed similar problems to this a couple months ago, but the utf8 ghost is back.

Event Timeline

mforns claimed this task.
mforns raised the priority of this task from to Needs Triage.
mforns updated the task description. (Show Details)
mforns subscribed.
mforns renamed this task from Wikimetrics' cohort page is returning 500 in production. to Wikimetrics' cohort page is returning 500 in production {dove}.Oct 7 2015, 11:49 AM
mforns moved this task from Next Up to In Progress on the Analytics-Kanban board.
mforns set Security to None.

The problem was that a user inserted a tag with the character:

ր

And it seems that the encoding we use does not support that.
It works with all other special characters that we used until today, but not this one... O.o

So, I removed the character in the tag, and the problem was gone.
I created a task to fix this properly to avoid similar issues in the future: T114884.

mforns renamed this task from Wikimetrics' cohort page is returning 500 in production {dove} to Wikimetrics' cohort page is returning 500 in production {dove} [3 pts].Oct 7 2015, 12:19 PM
mforns moved this task from In Progress to Done on the Analytics-Kanban board.
mforns renamed this task from Wikimetrics' cohort page is returning 500 in production {dove} [3 pts] to Wikimetrics' cohort page is returning 500 in production {dove} [2 pts].Oct 7 2015, 12:33 PM