jupyter / nbgrader

A system for assigning and grading notebooks
https://nbgrader.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.3k stars 317 forks source link

[multi-class setting] formgrader errors out if the service user does not exist in Jupyterhub's database #1872

Open goekce opened 7 months ago

goekce commented 7 months ago

Operating system

ArchLinux

nbgrader --version

0.9.2

jupyterhub --version (if used with JupyterHub)

4.0.2

jupyter notebook --version

7.1.2

Expected behavior

Formgrader page does not show an error.

Actual behavior

Error

 Sorry, the formgrader encountered an error. Please contact the administrator of the formgrader for further assistance. 

Steps to reproduce the behavior

  1. Use PAMAuthenticator
  2. Use SystemdSpawner (I believe this is unrelated)
  3. Follow the tutorial Example use case: multiple classes
  4. go to the class formgrader service page (example.com/services/test)
  5. . Click on Manage Assignments

Jupyterhub log:

... JupyterHub log:191] 404 GET /hub/api/users/grader-test ...
... ServerApp] Error: Not able to get Jupyterhub user: {authenticated_user}
... ServerApp] Make sure you start your service with a valid admin_user 'api_token' in your Jupyterhub config
... ServerApp] Uncaught exception GET /services/test/formgrader
...
nbgrader.auth.jupyterhub.JupyterhubApiError: JupyterhubAPI returned a status code of: 404 for api_path: /users/grader-test
ServerApp] 500 GET /services/test/formgrader

Browser request log

also shows a 500


Adding the service user (which already exists in /etc/passwd) using the admin panel solves the issue.

Why does the service user has to exist in Jupyterhub's database? Is this a bug or feature?