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

Stop escaping custom response errors #101

Open
pdpinch opened this issue Oct 19, 2018 · 7 comments
Open

Stop escaping custom response errors #101

pdpinch opened this issue Oct 19, 2018 · 7 comments

Comments

@pdpinch
Copy link
Member

pdpinch commented Oct 19, 2018

I thought we had already fixed this, but I guess not:

With a custom problem like:

<problem>
<script type="loncapa/python">
def grader(expect, answer):
    raise ValueError("It's not working again!")
</script>
<customresponse cfn="grader" expect="2*x">
<textline />
</customresponse>
</problem>

The response is:
screen shot 2018-10-19 at 12 21 25 pm

┆Issue is synchronized with this Trello card by Unito

@Ayub-Khan Ayub-Khan self-assigned this Dec 28, 2018
@Ayub-Khan
Copy link

@pdpinch i was not able to reproduce this against mitx/master or mitx/hawthorn-release.

@pdpinch
Copy link
Member Author

pdpinch commented Jan 2, 2019

@jolyonb can you reproduce this on edx.org? What about Residential MITx?

@jolyonb
Copy link
Collaborator

jolyonb commented Jan 2, 2019

I can reproduce this on edge.edx.org and on studio.mitx.mit.edu. Here is a screenshot, using the above:

screen shot 2019-01-02 at 12 40 10 pm

@jolyonb
Copy link
Collaborator

jolyonb commented Jan 2, 2019

Note that the issue here is that the apostrophe is being escaped, when it shouldn't be.

@pdpinch
Copy link
Member Author

pdpinch commented Jan 2, 2019

Ok, I can't reproduce this in devstack, but I definitely see it happening on edge, on stage.edx.org and on studio-staging.mitx. I think perhaps that in devstack the codejail is disabled, so that the python is run without being jailed. This leads to one less level of escaping in devstack (or maybe 2) in the response, so it's handled well. In production, it's escape more times, so the unescaping isn't effective.

I'm not sure what the fix is yet. Maybe the first thing to do is to figure out how to configure devstack similarly to a production install.

@jolyonb
Copy link
Collaborator

jolyonb commented Jan 2, 2019

That could well explain why this cropped up again. We fixed it in the devstack, but never tested it in production. I suspect that the fix we put in undid a second level of escaping...

@pdpinch
Copy link
Member Author

pdpinch commented Jan 30, 2019

@blarghmatey tells me that our codejail settings for Residential MITx are at https://github.com/mitodl/salt-ops/blob/master/pillar/edx/ansible_vars/residential.sls#L328

The current theory is that if one replicates those settings on their devstack, they should be able to reproduce the error.

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

No branches or pull requests

3 participants