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

Formgrader 404 (only for "owner") #93

Open
lukassnoek opened this issue Nov 1, 2017 · 2 comments
Open

Formgrader 404 (only for "owner") #93

lukassnoek opened this issue Nov 1, 2017 · 2 comments

Comments

@lukassnoek
Copy link

Hi! First of all, thank you for developing nbgrader (@jhamrick) and this particular jupyterhub deployment! I installed and configured out server to run this deployment a while ago, and everything worked smoothly (including the formgrader). However, after rebooting the server, suddenty I'm unable to access the formgrader (404 error). Interestingly, as the "owner" (as specified in the host_vars file) I'm the only one who cannot access the formgrader; other graders (and even students) can access it.

My set-up is largely the default setup as specified in the master branch of jupyterhub-deploy-teaching, apart from a couple of things.

My nbgrader_config.py file (located in ~/.jupyter) looks like the following:

# Ansible managed
# Configuration file for nbgrader.
c = get_config()

c.CourseDirectory.root = '/home/lsnoek1/nbgrader/neuroimaging_bold'
c.Exchange.course_id = 'neuroimaging_bold'

My nbextensions are set as follows (output from the command jupyter nbextension list):

Known nbextensions:
  config dir: /opt/conda/etc/jupyter/nbconfig
    notebook section
      validate_assignment/main  enabled
      - Validating: OK
      create_assignment/main  enabled
      - Validating: OK
    tree section
      assignment_list/main  enabled
      - Validating: OK
      formgrader/main  enabled
      - Validating: OK

And my /etc/jupyterhub/jupyterhub_config.py looks like this:

# Ansible managed
# Configuration file for jupyterhub.

c = get_config()
c.JupyterHub.ip = u'<our server address>'
c.JupyterHub.port = 8000
c.JupyterHub.cookie_secret_file = u'/srv/jupyterhub/cookie_secret'
c.JupyterHub.db_url = u'/srv/jupyterhub/jupyterhub.sqlite'
c.JupyterHub.proxy_auth_token = u''
c.JupyterHub.confirm_no_ssl = True

c.JupyterHub.load_groups = {
'formgrade-neuroimaging_bold': ['lsnoek1','grader2','grader3',],
}

c.Authenticator.admin_users = {'lsnoek1','grader1','grader2'}

c.Authenticator.whitelist = {'lsnoek1','grader1','grader2','student1', 'student2', <etc>}

c.JupyterHub.services = [
]   # the content of this field was removed as indicated in PR #88

I hope someone can help me because the course is starting soon, and I would love to use the formgrader for manual grading/giving feedback :)

Again, thanks a lot for developing this great tool/deployment scheme, and I'm looking forward to any tips that might help me solve this issue!

-Lukas

@jhamrick
Copy link

jhamrick commented Nov 1, 2017

That's definitely strange that you do not have access to the formgrader anymore. I'm not sure what the cause of that might be... at what path are people accessing the formgrader? Can you provide any command line output from when you try to access it vs. when someone else does?

Also, one thing to note is that for multiple graders you do actually still want to use a JupyterHub service. I realize this wasn't very clear before, and have recently updated the nbgrader documentation to be more explicit about this: http://nbgrader.readthedocs.io/en/latest/configuration/jupyterhub_config.html

@lukassnoek
Copy link
Author

lukassnoek commented Nov 3, 2017

Thanks for your quick reply! I managed to find the issue causing the 404. When I started Jupyter from the command line on the server ($ jupyter notebook), I got the following output:

lsnoek1@neuroimaging:~$ jupyter notebook
[I 14:33:32.246 NotebookApp] Loading the assignment_list nbgrader serverextension
[I 14:33:32.250 NotebookApp] Loading the formgrader nbgrader serverextension
[W 14:33:32.252 NotebookApp] Error loading server extension nbgrader.server_extensions.formgrader
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.5/site-packages/notebook/notebookapp.py", line 1346, in init_server_extensions
        func(self)
      File "/opt/conda/lib/python3.5/site-packages/nbgrader/server_extensions/formgrader/formgrader.py", line 72, in load_jupyter_server_extension
        formgrader.initialize([])
      File "<decorator-gen-117>", line 2, in initialize
      File "/opt/conda/lib/python3.5/site-packages/traitlets/config/application.py", line 87, in catch_config_error
        return method(app, *args, **kwargs)
      File "/opt/conda/lib/python3.5/site-packages/nbgrader/apps/baseapp.py", line 245, in initialize
        self.init_logging(logging.FileHandler, [self.logfile], color=False)
      File "/opt/conda/lib/python3.5/site-packages/nbgrader/apps/baseapp.py", line 81, in init_logging
        handler = handler_class(*handler_args)
      File "/opt/conda/lib/python3.5/logging/__init__.py", line 1008, in __init__
        StreamHandler.__init__(self, self._open())
      File "/opt/conda/lib/python3.5/logging/__init__.py", line 1037, in _open
        return open(self.baseFilename, self.mode, encoding=self.encoding)
    PermissionError: [Errno 13] Permission denied: '/home/lsnoek1/.nbgrader.log'

Turned out that, for some reason, the .nbgrader.log file was owned by root:

-rw-r--r--  1 root    root          232 okt 18 14:21 .nbgrader.log

Anyway, when I changed owner (sudo chown lsnoek1:lsnoek1 .nbgrader.log) and restarted the server, the formgrader worked again. Interestingly, this root-issue was only the case for the "owner" account; the .nbgrader.log files for the other graders and students are owned by their own account, explaining why they in fact could access the formgrader. No clue why my .nbgrader.log file was owned by root ... I probably did something stupid on my side ...

Anyway, thanks again for the help and keep up the good work with nbgrader :-)

Ps. Also, thanks for updating the nbgrader documentation. Our course using jupyterhub/nbgrader has already started, but I'll definitely use the set-up described in the documentation for our next course.

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

2 participants