TA debugging online submissions

From 6.034 Wiki

Jump to: navigation, search

This is intended to be a TA reference page of commonly encountered errors related to the online tester. This page is not intended to be shared with students.

Contents


Python version errors

Tester hangs forever or prints httplib.BadStatusLine: ' '

If the student is using Windows and there isn't an obvious key issue, the most likely culprit is the Python version, especially if the tester just hangs forever, or hangs for a while and then prints httplib.BadStatusLine: ' '. On Windows, Python 2.7 is often not sufficient: Python versions 2.6.5 through 2.7.3 seem to be incompatible with our server. In 2015, we found that 2.7.10 worked well with Windows.

If all else fails, you can ask students to submit from Athena. If their OS setup has the ability to transfer files to Athena (such as the scp command) and the ability to ssh into an Athena command line, they can submit through Athena without having to physically go to a cluster.

SyntaxError: Missing parentheses in call to 'print'

This error occurs even when the student tries to run the local tester. For example:

  File "tester.py", line 20
    print "Error: Can't find your 'key.py' file!  Please go download one from"
                                                                             ^
SyntaxError: Missing parentheses in call to 'print'

This means the student is probably running Python 3. Use the python2 command instead of python, or find some other way of running Python 2.

xmlrpclib.Fault

"Error: Either your key.py file is out of date, or online tests for lab0 are not currently available")

This error message is the nice way of the tester saying "traceback-traceback-traceback-... xmlrpclib.Fault".

This is usually caused by an out-of-date key.py file, which is sometimes a result of the student changing their Athena password. However, if you believe it might be a server error or something more complicated, you can ask the student comment out the except block in tester.py starting with except xmlrpclib.Fault: (for Lab 0, this is 5 lines of tester.py, probably near line 254), then try submitting again. This should result in an error traceback (printed in the command line). The end of the error traceback will probably say one of the following:

  • "<class 'tester.test.testutils.AuthenticationFailure'>:Error: invalid username or password.  Please make sure your key.py file is up-to-date."
This indicates an authentication problem, which could be caused by:
  • out-of-date key.py due to student changing their password
  • out-of-date key.py due to student using an expired certificate
  • the database was reset, invalidating all previous key.py files (this should only happen when the database is cleared once a year, so it is unlikely to occur during a semester)
If the student has tried re-downloading their key.py file and it didn't work, it's possible to manually update their password in the database so that their key will authenticate correctly. Instructions (may require superuser privileges):
  1. Go to a SHA1 hash generator such as [1].
  2. Open the student's key.py file in a text viewer and copy/paste the PASSWORD string (without the quotes) in the input string field.
  3. In the Django database, open the student's user page. (This is the step that may require superuser privileges.)
  4. In the Django database user page, find the Password field, which should look something like sha1$ac536$de872b11de91b01489ca980abeb89c0c9ed04463. The password is in the form [algo]$[salt]$[hexdigest]. Copy/paste the 5-character "salt" string into the "salt" field of the hash generator. If applicable, select the option of adding the salt before the string (not after).
  5. Copy the result from the hash generator. Delete the existing "hexdigest" portion of the student's Django password and paste the hashed result in its place.
  6. Click Save on the Django page.
  • "<class 'tester.test.models.DoesNotExist'>:Lab matching query does not exist."
This means the server is not currently accepting submissions. This is probably a Django database issue (the "lab" object (e.g. "lab0") is missing in the database).

Lab development errors

If the lab is currently in development, or if someone working on the lab broke some part of the tester system, you may see a less common xmlrpclib.Fault, such as one of the following:

  • xmlrpclib.Fault: <Fault 1: "<class 'tester.test.models.MultipleObjectsReturned'>:get() returned more than one LabTestInstance -- it returned 2! Lookup parameters were {'endtime__isnull': True, 'lab__name': 'lab2', 'user': <User: jmn_MIT_EDU>}">
Solution: Just submit again. This might occur if you try to submit the lab twice at the same time using the same key.py file.
  • xmlrpclib.Fault: <Fault 1: "<class '_mysql_exceptions.OperationalError'>:(1040, 'Too many connections')">
Same deal as above, maybe? Just submit again. I've only ever seen this once.
  • xmlrpclib.Fault: <Fault 1: "<type 'exceptions.TypeError'>:unhashable type: 'list'">
Apparently we're not actually pickling things, so that's fun. More on this later. (jmn todo)
  • xmlrpclib.Fault: <Fault 1: "<type 'exceptions.TypeError'>:can't pickle function objects">
Solution (lab development): Convert all lambdas in the online test file (e.g. .../tester/test/tests/lab3.py) to named functions.
  • xmlrpclib.Fault: <Fault 1: "<type 'exceptions.TypeError'>:cannot marshal recursive dictionaries">
Solution: remove recursive class attributes (e.g. the .zipper attribute that used to be in the ToyTree class for Lab 3)
  • TypeError: cannot marshal <type 'wrapper_descriptor'> objects
Student probably tried to return a type, such as list. Tester doesn't like this.
  • mlrpclib.Fault: <Fault 1: "<type 'exceptions.NotImplementedError'>:">
Don't raise errors in online tests. It crashes stuff. (jmn todo)

TypeError

TypeError: cannot marshal ...

This error takes many possible forms.

  • TypeError: cannot marshal <type 'numpy.float64'> objects
The student tried to submit a NumPy object to the server, and the server freaked out because it didn't know how to encode/decode/pickle the object. Either don't return NumPy objects, or (for lab developers) please have the tester *actually* pickle things.
  • TypeError: cannot marshal <type 'set'> objects
Don't ever try to send Python sets to the server. Just don't. More on that later... (jmn todo)

Lab development errors

These are errors that you're unlikely to encounter unless you're actively writing/editing online tests for a lab.

  • TypeError: make_test() takes at least 4 arguments (5 given)
I know, it sounds like there's a sign error on the "at least". But the online version of make_test has four required arguments and many optional ones, so this is how it complains if you provide only 3 of the required arguments (e.g. not labname=LAB) plus 2 optional arguments.
  • TypeError: dictionary key must be string
(jmn todo)
Personal tools