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

missing #1306

Closed
alexlopespereira opened this issue Jan 22, 2020 · 8 comments
Closed

missing #1306

alexlopespereira opened this issue Jan 22, 2020 · 8 comments

Comments

@alexlopespereira
Copy link

alexlopespereira commented Jan 22, 2020

Operating system

Ubuntu 18.04

nbgrader --version

0.6.1

jupyterhub --version (if used with JupyterHub)

1.0.0b1

jupyter notebook --version

5.7.8

Expected behavior

I expected to generate feedback.

Actual behavior

Instead I received the error messages below:

[ERROR] There was an error processing assignment: /home/jovyan/bootcamp/autograded/test/ex1
[ERROR] Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/nbgrader/converters/base.py", line 336, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "/opt/conda/lib/python3.7/site-packages/nbgrader/converters/base.py", line 292, in convert_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "/opt/conda/lib/python3.7/site-packages/nbconvert/exporters/exporter.py", line 179, in from_filename
return self.from_file(f, resources=resources, **kw)
File "/opt/conda/lib/python3.7/site-packages/nbconvert/exporters/exporter.py", line 197, in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
File "/opt/conda/lib/python3.7/site-packages/nbconvert/exporters/html.py", line 100, in from_notebook_node
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw)
File "/opt/conda/lib/python3.7/site-packages/nbconvert/exporters/templateexporter.py", line 357, in from_notebook_node
output = self.template.render(nb=nb_copy, resources=resources)
File "/opt/conda/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "/opt/conda/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/opt/conda/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/opt/conda/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "/opt/conda/lib/python3.7/site-packages/nbgrader/server_extensions/formgrader/templates/feedback.tpl", line 1, in top-level template code
{%- extends 'basic.tpl' -%}
jinja2.exceptions.TemplateNotFound: basic.tpl

I tried to find such file, but I only found the base.tpl one, which I guess is not the right one to import.
How could I solve this?

@ttimbers
Copy link

ttimbers commented Oct 3, 2020

I have just run into this as well after installing nbgrader 0.6.1 on a JupyterHub, using an image built off of this base image: https://github.com/jupyter/docker-stacks/tree/master/scipy-notebook, but not this one: https://github.com/jupyter/docker-stacks/tree/master/r-notebook

Not sure what the difference is yet... Here's my error for the record:

Log output:

[WARNING] Config option `template_path` not recognized by `HTMLExporter`.  Did you mean one of: `template_file, template_name, template_paths`?
[INFO] Copying /home/jupyter/autograded/student_10870/assignment1/marathon_small.csv -> /home/jupyter/feedback/student_10870/assignment1/marathon_small.csv
[INFO] Copying /home/jupyter/autograded/student_10870/assignment1/test_assignment1.py -> /home/jupyter/feedback/student_10870/assignment1/test_assignment1.py
[INFO] Copying /home/jupyter/autograded/student_10870/assignment1/static/error-message.ai -> /home/jupyter/feedback/student_10870/assignment1/static/error-message.ai
[INFO] Copying /home/jupyter/autograded/student_10870/assignment1/static/answering_jupyter.mp4 -> /home/jupyter/feedback/student_10870/assignment1/static/answering_jupyter.mp4
[INFO] Copying /home/jupyter/autograded/student_10870/assignment1/static/error-message.png -> /home/jupyter/feedback/student_10870/assignment1/static/error-message.png
[INFO] Copying /home/jupyter/autograded/student_10870/assignment1/static/saving_jupyter.mp4 -> /home/jupyter/feedback/student_10870/assignment1/static/saving_jupyter.mp4
[INFO] Copying /home/jupyter/autograded/student_10870/assignment1/data/canucks.csv -> /home/jupyter/feedback/student_10870/assignment1/data/canucks.csv
[INFO] Copying /home/jupyter/autograded/student_10870/assignment1/data/marathon_smaller.csv -> /home/jupyter/feedback/student_10870/assignment1/data/marathon_smaller.csv
[INFO] Copying /home/jupyter/autograded/student_10870/assignment1/data/marathon_small_sorted.csv -> /home/jupyter/feedback/student_10870/assignment1/data/marathon_small_sorted.csv
[INFO] Copying /home/jupyter/autograded/student_10870/assignment1/data/spotify.csv -> /home/jupyter/feedback/student_10870/assignment1/data/spotify.csv
[INFO] Converting notebook /home/jupyter/autograded/student_10870/assignment1/assignment1.ipynb
[ERROR] There was an error processing assignment: /home/jupyter/autograded/student_10870/assignment1
[ERROR] Traceback (most recent call last):
      File "/opt/conda/lib/python3.8/site-packages/nbgrader/converters/base.py", line 336, in convert_notebooks
        self.convert_single_notebook(notebook_filename)
      File "/opt/conda/lib/python3.8/site-packages/nbgrader/converters/base.py", line 292, in convert_single_notebook
        output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
      File "/opt/conda/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 182, in from_filename
        return self.from_file(f, resources=resources, **kw)
      File "/opt/conda/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 200, in from_file
        return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
      File "/opt/conda/lib/python3.8/site-packages/nbconvert/exporters/html.py", line 122, in from_notebook_node
        return super().from_notebook_node(nb, resources, **kw)
      File "/opt/conda/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 382, in from_notebook_node
        output = self.template.render(nb=nb_copy, resources=resources)
      File "/opt/conda/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 143, in template
        self._template_cached = self._load_template()
      File "/opt/conda/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 353, in _load_template
        return self.environment.get_template(template_file)
      File "/opt/conda/lib/python3.8/site-packages/jinja2/environment.py", line 883, in get_template
        return self._load_template(name, self.make_globals(globals))
      File "/opt/conda/lib/python3.8/site-packages/jinja2/environment.py", line 857, in _load_template
        template = self.loader.load(self, name, globals)
      File "/opt/conda/lib/python3.8/site-packages/jinja2/loaders.py", line 429, in load
        raise TemplateNotFound(name)
    jinja2.exceptions.TemplateNotFound: feedback.tpl
    
[WARNING] Removing failed assignment: /home/jupyter/feedback/student_10870/assignment1
[ERROR] There was an error processing assignment 'assignment1' for student 'student_10870'
[ERROR] Please see the the above traceback for details on the specific errors on the above failures.

Traceback:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/nbgrader/utils.py", line 514, in capture_log
    app.start()
  File "/opt/conda/lib/python3.8/site-packages/nbgrader/converters/base.py", line 74, in start
    self.convert_notebooks()
  File "/opt/conda/lib/python3.8/site-packages/nbgrader/converters/base.py", line 413, in convert_notebooks
    raise NbGraderException(msg)
nbgrader.converters.base.NbGraderException: Please see the the above traceback for details on the specific errors on the above failures.

@ttimbers
Copy link

ttimbers commented Oct 3, 2020

I can confirm in both images, that the file is here: /opt/conda/lib/python3.8/site-packages/nbgrader/server_extensions/formgrader/templates/feedback.tpl but it is not findable in one of the images...

@agahkarakuzu
Copy link

You can try this:

pip install --upgrade nbconvert==5.5

which fixed the problem for me, and the solution was still persistent after I re-upgrade to the latest (6.0.7) nbconvert version.

@lwasser
Copy link

lwasser commented Oct 9, 2020

i'm running into the same issue @ttimbers mentioned above. it seems like nbgrader needs atleast nbconvert 5.6 when i try to downgrade ... still troubleshooting.

for me it seems as if downgrading to nbconvert 5.6.1 worked locally. i'm still having issues on our hub but think i may try to pin nbconvert in our docker image.

@agahkarakuzu
Copy link

@lwasser I run into the same problem working with another package, so did not know about nbgrader version reqs, sorry about that. Happy that 5.6.1 was still in the safe zone though.

Some change introduced in one of the releases (I did not go through them all to find out which one exactly), nbconvert fails to locate templates.

@lwasser
Copy link

lwasser commented Oct 9, 2020

hi there @agahkarakuzu !! i didn't know about the requirements, either :) 5.6.1 so far does seem to work. What is also really odd is that feedback had been working for us and then it stopped working! it's nice however that there is a local fix :)

I noticed here: https://github.com/jupyter/nbgrader/blob/master/setup.py#L94 that nbconvert is indeed pinned to 5.6.1 -- it was mentioned in another thread somewhere so perhaps we all just need to pin it in our docker containers as well? your post was super helpful regardless as downgrading did work!

@ttimbers
Copy link

ttimbers commented Mar 19, 2021

I can confirm pinning nbconvert to 5.6.1 worked for us too on multiple of our JupyterHubs. So this is a short-term fix. There is work going on to address this in #1421 for the long term it seems (just posting this here in case anyone stumbles across this issue).

@jhamrick jhamrick added this to the No action milestone Mar 25, 2021
@jhamrick
Copy link
Member

Thanks for linking to the PR @ttimbers !

I am going to close this issue as a duplicate of #1373

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

No branches or pull requests

5 participants