503 : service unavailable (services)


I upgraded jupyterhub to 1.3.0 (jinja2 2.11.3), but all my services stopped showing up. For example the jupyterhub_announcement service, I get 503 : service unavailable and in the log file:

15:34:30.180 [ConfigProxy] debug: PROXY WEB /services/announcement/ to
jupyterhub[31684]: ERROR:tornado.application:Uncaught exception
jupyterhub[31684]: Traceback (most recent call last):
jupyterhub[31684]: File "/usr/local/lib64/python3.6/site-packages/tornado/http1connection.py", line 273, in _read_message
jupyterhub[31684]: delegate.finish()
jupyterhub[31684]: File "/usr/local/lib64/python3.6/site-packages/tornado/routing.py", line 268, in finish
jupyterhub[31684]: self.delegate.finish()
jupyterhub[31684]: File "/usr/local/lib64/python3.6/site-packages/tornado/web.py", line 2297, in finish
jupyterhub[31684]: self.execute()
jupyterhub[31684]: File "/usr/local/lib64/python3.6/site-packages/tornado/web.py", line 2317, in execute
jupyterhub[31684]: self.application, self.request, **self.handler_kwargs
jupyterhub[31684]: File "/usr/local/lib64/python3.6/site-packages/tornado/web.py", line 233, in __init__
jupyterhub[31684]: self.initialize(**kwargs)  # type: ignore
jupyterhub[31684]: File "/usr/local/lib/python3.6/site-packages/jupyterhub_announcement/announcement.py", line 132, in initialize
jupyterhub[31684]: self.template = self.env.get_template("index.html")
jupyterhub[31684]: File "/home/jupyterhub/.local/lib/python3.6/site-packages/jinja2/environment.py", line 883, in get_template
jupyterhub[31684]: return self._load_template(name, self.make_globals(globals))
jupyterhub[31684]: File "/home/jupyterhub/.local/lib/python3.6/site-packages/jinja2/environment.py", line 857, in _load_template
jupyterhub[31684]: template = self.loader.load(self, name, globals)
jupyterhub[31684]: File "/home/jupyterhub/.local/lib/python3.6/site-packages/jinja2/loaders.py", line 429, in load
jupyterhub[31684]: raise TemplateNotFound(name)
jupyterhub[31684]: jinja2.exceptions.TemplateNotFound: index.html
jupyterhub[31684]: 15:34:30.183 [ConfigProxy] error: 503 GET /services/announcement/ socket hang up
jupyterhub[31684]: [D 2021-04-08 15:34:30.186 JupyterHub pages:648] No template for 503

I got the same error with similar services. Downgrading jinja2 to 2.10.1 for example fixes temporary the problem.

Any idea?

If you have time would you mind figuring out which version of jinja2 first broke things?

It would also be helpful if you could try to reproduce this with a fresh installation of JupyterHub (in a new virtualenv).

@manics the version of jinja2 that broke is 2.11.3. Actually, it was upgraded automatically when upgrading jupyterhub.