Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't download source from tests with grader because the link to the file has the wrong extension #1179

Closed
CristianCantoro opened this issue May 14, 2021 · 4 comments

Comments

@CristianCantoro
Copy link
Contributor

CristianCantoro commented May 14, 2021

Issue template

Description:

Downloading the source code from tests with grader fails with Error 500 because they have the wrong extension, task.%25l instead of task.cpp. Note that changing manually the extension to the correct one (%25l -> .cpp) the file is downloaded.

Steps to reproduce:

  1. apply the patch as in User testing does not pick up header files #1153.
  2. upload a test for a task with a grader, ìnput.txt, task.cpp, grader.cpp.
  3. try to download the source of the task.

Laboratoriodialgoritmi—MozillaFirefox_2021-05-15_00:38:51

Expected:

The source code of the test (task.cpp) is downloaded.

Actual:

The server responds with a 500 error because the link is incorrect. In the example:

http://<domain.tld>/tasks/tsp/tests/1/files/tsp.%25l

Error500—MozillaFirefox_2021-05-15_00:39:00

instead of:

http://<domain.tld>/tasks/tsp/tests/1/files/tsp.cpp

Changing the link works and the file is downloaded:

Workspace1_2021-05-15_00:43:31

Logs

From /var/local/log/cms/ContestWebServer-0: 2021-05-15-00-04-07.log

System Information

CMS version: [master, or a specific version]
Was CMS installed: yes, system-wide
Using a virtualenv: no
Postgres version: not relevant
Distribution and version: Ubuntu 20.04.2 LTS

@CristianCantoro CristianCantoro changed the title Source download from tests with grader doesn't download because it has the wrong extension Can't download source from tests with grader because the link to the file has the wrong extension May 15, 2021
@ranaldmiao ranaldmiao mentioned this issue May 15, 2021
@andreyv
Copy link
Member

andreyv commented May 18, 2021

The immediate problem should be fixed in dbd6645 by @ranaldmiao.

Note, however, that I couldn't reproduce the HTTP 500 status with CMS master. Out of interest, which python3-xdg Ubuntu package version do you have?

Anyway, applying the above patch should fix the problem in any case. You can test the patch with your installation.

@CristianCantoro
Copy link
Contributor Author

The immediate problem should be fixed in dbd6645 by @ranaldmiao.

Thank you.

Note, however, that I couldn't reproduce the HTTP 500 status with CMS master. Out of interest, which python3-xdg Ubuntu package version do you have?

$ sudo pip3 freeze | grep xdg
pyxdg==0.25

(I have CMS installed system-wide)

@andreyv
Copy link
Member

andreyv commented Jun 7, 2021

@CristianCantoro Were you able to test the patch with your installation? Does it work?

@CristianCantoro
Copy link
Contributor Author

@andreyv said:

@CristianCantoro Were you able to test the patch with your installation? Does it work?

Yes, I confirm that I was able to patch my installation and it works. Thank you, @andreyv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants