Page MenuHomePhabricator

Fix errorred state for missing rev_ids
Closed, ResolvedPublic


Looks like this is a regression in ORES. When an rev_id can't be found, it fully errors rather than returning other scores.

Event Timeline

wow! Ran into a crazy one. Check this one. Currently, if I request|2342342352352, I get

  "error": {
    "code": "internal server error",
    "message": "Traceback (most recent call last):\n  File \"./ores/wsgi/routes/v3/\", line 25, in process_score_request\n    return util.format_v3_score_response(score_response)\n  File \"./ores/wsgi/routes/v3/\", line 64, in format_v3_score_response\n    return jsonify({ context_doc})\n  File \"/srv/ores/venv/lib/python3.4/site-packages/\", line 77, in jsonpify\n    return current_app.response_class(__pad(__dumps(*args, **kwargs)),\n  File \"/srv/ores/venv/lib/python3.4/site-packages/\", line 30, in __dumps\n    indent=indent)\n  File \"/srv/ores/venv/lib/python3.4/site-packages/flask/\", line 126, in dumps\n    rv = _json.dumps(obj, **kwargs)\n  File \"/usr/lib/python3.4/json/\", line 237, in dumps\n    **kw).encode(obj)\n  File \"/usr/lib/python3.4/json/\", line 194, in encode\n    chunks = list(chunks)\n  File \"/usr/lib/python3.4/json/\", line 422, in _iterencode\n    yield from _iterencode_dict(o, _current_indent_level)\n  File \"/usr/lib/python3.4/json/\", line 396, in _iterencode_dict\n    yield from chunks\n  File \"/usr/lib/python3.4/json/\", line 396, in _iterencode_dict\n    yield from chunks\n  File \"/usr/lib/python3.4/json/\", line 345, in _iterencode_dict\n    items = sorted(dct.items(), key=lambda kv: kv[0])\nTypeError: unorderable types: int() < str()\n"

This is due to this bug:

I'm working on a custom JSON encoder as a work-around.