cms icon indicating copy to clipboard operation
cms copied to clipboard

cms crashes on unknown programming language

Open eljakim opened this issue 7 years ago • 0 comments

Is this an issue or you just need help?

It's an issue.

Issue template

Description: When you open a database that contains a submission in a language that is not supported, you get a 500 error on the client.

This is following up on a discussion on gitter, CMS should handle this a bit more robust.

Steps to reproduce:

  1. [First step] Load a database that contains submissions in a programming language that has not been added to your local installation.

  2. [Second step] Go to the admin interface, click on the contest that has the submission. Then click on 'Submissions'.

Expected: A list of submissions is shown.

Actual: [What happened instead?] 500 error

Logs

2019-01-07 18:30:35,069 - ERROR [Admin,0] Uncaught exception GET /contest/2/submissions (::ffff:192.168.75.30) HTTPServerRequest(protocol='http', host='192.168.80.147:8889', method='GET', uri='/contest/2/submissions', version='HTTP/1.1', remote_ip='::ffff:192.168.75.30', headers={'Host': '192.168.80.147:8889', 'Accept-Encoding': 'gzip, deflate', 'Cookie': 'awslogin="PAGoHHArImGeegpav1QIe/OQFLc=?id=MQ==&ip=Ijo6ZmZmZjoxOTIuMTY4Ljc1LjMwIg==&timestamp=MTU0Njg4MjIzMS4zNTk4MzI4"; _xsrf=2|d3b73bde|0b8a9f692efe68f9ca22773649d257a9|1546882202', 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15', 'Referer': 'http://192.168.80.147:8889/contest/2/submissions', 'Dnt': '1', 'Accept-Language': 'en-us'}) Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1510, in _execute result = method(*self.path_args, **self.path_kwargs) File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 2898, in wrapper return method(self, *args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/handlers/base.py", line 173, in newfunc return func(self, *args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/handlers/contestsubmission.py", line 47, in get self.render("contest_submissions.html", **self.r_params) File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/handlers/base.py", line 281, in render for chunk in t.generate(**params): File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1045, in generate yield self.environment.handle_exception(exc_info, True) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/contest_submissions.html", line 1, in top-level template code {% extends "base.html" %} File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/base.html", line 260, in top-level template code {% block core %}{% endblock core %} File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/contest_submissions.html", line 16, in block "core" {% include "fragments/submission_rows.html" %} File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/fragments/submission_rows.html", line 36, in top-level template code {% include "fragments/submission_row.html" %} File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/fragments/submission_row.html", line 94, in top-level template code {% set real_filename = filename if s.language is none else filename|replace(".%l", (s.language|to_language).source_extension) %} File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/grading/languagemanager.py", line 48, in get_language raise KeyError("Language %s' not supported." % name) KeyError: "Language Objective C' not supported." 2019-01-07 18:30:35,071 - ERROR [Admin,0] Uncaught exception (KeyError("Language Objective C' not supported.",)) while processing a request: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1510, in _execute result = method(*self.path_args, **self.path_kwargs) File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 2898, in wrapper return method(self, *args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/handlers/base.py", line 173, in newfunc return func(self, *args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/handlers/contestsubmission.py", line 47, in get self.render("contest_submissions.html", **self.r_params) File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/handlers/base.py", line 281, in render for chunk in t.generate(**params): File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1045, in generate yield self.environment.handle_exception(exc_info, True) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/contest_submissions.html", line 1, in top-level template code {% extends "base.html" %} File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/base.html", line 260, in top-level template code {% block core %}{% endblock core %} File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/contest_submissions.html", line 16, in block "core" {% include "fragments/submission_rows.html" %} File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/fragments/submission_rows.html", line 36, in top-level template code {% include "fragments/submission_row.html" %} File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/server/admin/templates/fragments/submission_row.html", line 94, in top-level template code {% set real_filename = filename if s.language is none else filename|replace(".%l", (s.language|to_language).source_extension) %} File "/usr/local/lib/python3.6/dist-packages/cms-1.5.dev0-py3.6.egg/cms/grading/languagemanager.py", line 48, in get_language raise KeyError("Language %s' not supported." % name) KeyError: "Language `Objective C' not supported."

System Information

CMS version: [master] Was CMS installed: [yes] Using a virtualenv: [not relevant] Postgres version: [not relevant] Distribution and version: [if relevant]

eljakim avatar Jan 07 '19 17:01 eljakim