vijos / vj4

The online judge service with millions of submissions, since 2005.
https://vijos.org
GNU Affero General Public License v3.0
531 stars 109 forks source link

Deleted users causes 500 in scoreboards. #365

Open ksyx opened 6 years ago

ksyx commented 6 years ago

image

iceboy233 commented 6 years ago

could be related

Oct 29 04:10:02 vj4 python3[1010]: #033[31m[E 171029 04:10:02 base:245]#033[0m System error by /contest/51122cdf4e411264120000c3/scoreboard 106.11.154.162 1: KeyError(82136,)#033[0m
Oct 29 04:10:03 vj4 python3[1010]: #033[31m[E 171029 04:10:02 web_protocol:362]#033[0m Error handling request
Oct 29 04:10:03 vj4 python3[1010]: Traceback (most recent call last):
Oct 29 04:10:03 vj4 python3[1010]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_protocol.py", line 422, in start
Oct 29 04:10:03 vj4 python3[1010]:     resp = yield from self._request_handler(request)
Oct 29 04:10:03 vj4 python3[1010]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web.py", line 306, in _handle
Oct 29 04:10:03 vj4 python3[1010]:     resp = yield from handler(request)
Oct 29 04:10:03 vj4 python3[1010]:   File "/home/vijos/vj4/vj4/handler/base.py", line 226, in __iter__
Oct 29 04:10:03 vj4 python3[1010]:     yield from super(Handler, self).__iter__()
Oct 29 04:10:03 vj4 python3[1010]:   File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_urldispatcher.py", line 657, in __iter__
Oct 29 04:10:03 vj4 python3[1010]:     resp = yield from method()
Oct 29 04:10:03 vj4 python3[1010]:   File "/home/vijos/vj4/vj4/handler/contest.py", line 330, in get
Oct 29 04:10:03 vj4 python3[1010]:     tdoc, rows = await self.get_scoreboard(tid)
Oct 29 04:10:03 vj4 python3[1010]:   File "/home/vijos/vj4/vj4/handler/contest.py", line 94, in get_scoreboard
Oct 29 04:10:03 vj4 python3[1010]:     ranked_tsdocs, udict, pdict)
Oct 29 04:10:03 vj4 python3[1010]:   File "/home/vijos/vj4/vj4/model/adaptor/contest.py", line 108, in _oi_scoreboard
Oct 29 04:10:03 vj4 python3[1010]:     'value': udict[tsdoc['uid']]['uname'], 'raw': udict[tsdoc['uid']]})
Oct 29 04:10:03 vj4 python3[1010]: KeyError: 82136#033[0m
iceboy233 commented 5 years ago

d0cc83363031fbae8cddc9a02b35f11084ff1520 supports builtin users to get_dict

However there are non-builtin deleted users in some contests, example: https://vijos.org/contest/51122cdb4e4112641200008e/scoreboard