First Programming Assignment fails due to error in nbgrader

I completed the assignment and everything passed.
But, I received this error after submission and got zero points …

[ValidateApp | ERROR] nbgrader encountered a fatal error while trying to validate ‘submitted/courseraLearner/W2A1/Python_Basics_with_Numpy.ipynb’

I’ve downloaded a local copy and resubmitted, etc, a couple of times.
Any suggestions would be appreciated.

This is also happening to my week 2 Submission:

[ValidateApp | INFO] Validating '/home/jovyan/work/submitted/courseraLearner/W2A2/Logistic_Regression_with_a_Neural_Network_mindset.ipynb'
[ValidateApp | ERROR] Traceback (most recent call last):
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/preprocessors/checkcellmetadata.py", line 11, in preprocess
        MetadataValidator().validate_nb(nb)
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/nbgraderformat/v3.py", line 107, in validate_nb
        raise ValidationError("Duplicate grade id: {}".format(grade_id))
    jsonschema.exceptions.ValidationError: Duplicate grade id: cell-c4e7e9c1f174eb83
    
[ValidateApp | ERROR] Notebook failed to validate; the nbgrader metadata may be corrupted.
[ValidateApp | ERROR] Traceback (most recent call last):
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/apps/validateapp.py", line 72, in start
        validator.validate_and_print(filename)
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/validator.py", line 340, in validate_and_print
        results = self.validate(filename)
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/validator.py", line 311, in validate
        nb = self._preprocess(nb)
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/validator.py", line 290, in _preprocess
        nb, resources = pp.preprocess(nb, resources)
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/preprocessors/checkcellmetadata.py", line 16, in preprocess
        raise ValidationError(msg)
    jsonschema.exceptions.ValidationError: Notebook failed to validate; the nbgrader metadata may be corrupted.
    
[ValidateApp | ERROR] nbgrader encountered a fatal error while trying to validate 'submitted/courseraLearner/W2A2/Logistic_Regression_with_a_Neural_Network_mindset.ipynb'

It looks like you may have duplicated some of the cells in the notebook either accidentally or on purpose. It might be worth getting a clean copy of the notebook and then carefully “copy/pasting” over just your completed code. There is a topic about how to do that on the FAQ Thread.

Also I’m a little worried about your first post. You refer to submitting a “downloaded local copy”. Who said anything about that w.r.t. grading? The way you submit to the grader is by clicking the “Submit Assignment” button in the same copy of the notebook that was opened by the “Work in Browser” link for that assignment.

Yup!
That was definitely it. There were duplicate cells.
Next time i’ll know that when I make a copy and work in it, that a full “ctrl-a, ctrl-v” doesn’t do a “select all, copy and replace”!

I’m not sure I know exactly what you are describing, but note that there are lots of supported ways to make a copy of one of the notebooks or to download a copy of it. Click the “File” menu and you’ll see lots of choices, including “Make a copy” and “Download”. Or if you click “File → Open”, you get a file navigation menu that includes “Duplicate”, “Rename” and “Download” as functions.

1 Like