-
Notifications
You must be signed in to change notification settings - Fork 13
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
[BUG] Sandbox failing with Python 3.8 #19
Comments
Hey @jmbowman, did you folks see an error of this sort when upgrading edx.org's edx-sandbox environment to Python 3.8? |
(now that was a silly idea) |
My first suspicion would be some sort of mismatch with either the Python version set up in the apparmor configuration or the name of the binary being executed, but Ned might have a better idea; I'll point him here. Also note that we figured out a way to test codejail with apparmor enforced in GitHub Actions, something like that may be useful for CI here also: https://github.com/openedx/codejail/blob/master/.github/workflows/ci.yml . |
I don't remember an error like this, but "encodings" I think is the first module imported from the file system, after a few modules imported from frozen modules. Do all of the directories mentioned in the configuration exist? You could try adding "-vv" to the Python command line to see all the import activity, which might have some clues. |
I believe I found the problem: this line was not upgraded to 3.8.5 tutor-contrib-codejail/tutorcodejail/templates/codejail/apps/profiles/docker-edx-sandbox Line 55 in c9d0027
On my machine, after I modify this line and reload the apparmor profile (with |
Thank you for the help! Really appreciated! @nedbat @jmbowman @regisb @kdmccormick 😀 I finally got this working! Regis was totally right! I totally missed that line. Thank you so much. I'm closing this issue now. |
The bug seems to be back on Nutmeg (Tutor 14.0.4) with the latest plugin (ce71496) 😅 |
Hello @Abdess! Can you try removing the app armor profile & creating it again with the nutmeg version of this plugin? |
Hello @mariajgrimaldi! :) In case of doubt, you are talking about this file, right? |
Yes! @Abdess, I was referring to the profile created using that file. Can you list how did you get to that error? To see if I can reproduce it. Thanks (include all possible details) 😄 |
For the details, it will be relatively short, because I just followed the README. 😅 I use Tutor 14.0.4 with Nutmeg. Here are the steps performed:
I stay available to answer all your questions. |
Thanks again @Abdess; I have a few questions:
This might again have something to do with the current profile you're using. |
You're welcome @mariajgrimaldi; To answer the questions:
I stay tuned if you have any manipulations to suggest. |
Description
The codejailservice fails to execute code when using Python 3.8 in the secure sandbox.
To Reproduce
Steps to reproduce the behavior:
Further testing:
python
, the same error will appearExpected behavior
A clear and concise description of what you expected to happen.
Additional context
We encountered this error while giving nutmeg support to the plugin. First, trying to use a Python Evaluated component in a course:
After entering the codejailservice container to inspect contents, we found that running
python
using the sandbox virtualenv failed:With the same error as the course component. Then, we ran the same command but without the docker-compose files:
And it worked. So it must be something in the docker-compose configurations. After removing this line, the command worked with the docker-compose files. So what's going on with the apparmor profile & python3.8? 🤔
For reference, here is the appamor profile defined by this plugin.
The text was updated successfully, but these errors were encountered: