Uncaught exception GET /hub/spawn "json not defined"

hello,

For the dummy authenticator, I keep getting the below error in z2jh.

 Uncaught exception GET /hub/spawn (10.42.0.1)
    HTTPServerRequest(protocol='http', host='mydomain', method='GET', uri='/hub/spawn', version='HTTP/1.1', remote_ip='10.42.0.1')
    Traceback (most recent call last):
      File "/usr/local/lib/python3.11/site-packages/tornado/web.py", line 1786, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/jupyterhub/handlers/pages.py", line 178, in _get
        await spawner.run_auth_state_hook(auth_state)
      File "/usr/local/lib/python3.11/site-packages/jupyterhub/spawner.py", line 1254, in run_auth_state_hook
        await maybe_future(self.auth_state_hook(self, auth_state))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<string>", line 25, in userdata_hook
    NameError: name 'json' is not defined

best

Could you share your config? Seems like the error is coming from your auth_state_hook. Probably you are using json package but have not imported it in the hook?

3 Likes

Hi,

Thanks for youre reply. I added import json in the configuration and it worked.

best

1 Like