Error 500 on admin page

Hi,
I get “500 : Internal Server Error” when I try to access admin page. I’m admin and I can login and run notebooks as a user. However, accessing to admin page is giving error now. It used to be working fine. I shutdown the hub and restarted it with Helm and now admin page is not accessible. I haven’t changed anything in Helm config.
I have searched for similar issues and couldn’t find any solution. Could someone point me to right direction please? Thanks

[E 2021-12-03 09:56:08.694 JupyterHub web:1792] Uncaught exception GET /hub/admin (redacted)
    HTTPServerRequest(protocol='http', redacted', method='GET', uri='/hub/admin', version='HTTP/1.1', remote_ip='redacted')
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1703, in _execute
        result = await result
      File "/home/jovyan/.local/lib/python3.6/site-packages/jupyterhub/handlers/pages.py", line 467, in get
        api_page_limit=self.settings["api_page_default_limit"],
      File "/usr/local/lib/python3.6/dist-packages/jinja2/asyncsupport.py", line 65, in render_async
        return self.environment.handle_exception()
      File "/usr/local/lib/python3.6/dist-packages/jinja2/environment.py", line 832, in handle_exception
        reraise(*rewrite_traceback_stack(source=source))
      File "/usr/local/lib/python3.6/dist-packages/jinja2/_compat.py", line 28, in reraise
        raise value.with_traceback(tb)
      File "/usr/local/lib/python3.6/dist-packages/jinja2/asyncsupport.py", line 25, in concat_async
        await collect()
      File "/usr/local/lib/python3.6/dist-packages/jinja2/asyncsupport.py", line 22, in collect
        async for event in async_gen:
      File "/etc/jupyterhub/templates/admin.html", line 7, in top-level template code
        fa-sort-asc
      File "/etc/jupyterhub/templates/page.html", line 173, in top-level template code
        {% block main %}
      File "/etc/jupyterhub/templates/admin.html", line 21, in block "main"
        <table class="table table-striped">
      File "/etc/jupyterhub/templates/admin.html", line 22, in block "thead"
        <thead>
      File "/usr/local/lib/python3.6/dist-packages/jinja2/asyncsupport.py", line 174, in auto_await
        return await value
      File "/etc/jupyterhub/templates/admin.html", line 6, in template
        <a href="#"><i class="fa {% if sort.get(key) == 'asc' -%}
      File "/usr/local/lib/python3.6/dist-packages/jinja2/environment.py", line 471, in getattr
        return getattr(obj, attribute)
    jinja2.exceptions.UndefinedError: 'sort' is undefined

[E 2021-12-03 09:56:08.696 JupyterHub log:181] {
      "X-Real-Ip": "10.1.4.110",
      "X-Forwarded-Server": "traefik-b67579bb8-97lpr",
      "X-Forwarded-Proto": "http,http",
      "X-Forwarded-Port": "80,80",
      "X-Forwarded-Host": "redacted",
      "X-Forwarded-For": "redacted",
      "Upgrade-Insecure-Requests": "1",
      "Sec-Fetch-User": "?1",
      "Sec-Fetch-Site": "same-origin",
      "Sec-Fetch-Mode": "navigate",
      "Sec-Fetch-Dest": "document",
      "Sec-Ch-Ua-Platform": "\"Windows\"",
      "Sec-Ch-Ua-Mobile": "?0",
      "Sec-Ch-Ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"96\", \"Google Chrome\";v=\"96\"",
      "Referer": "redacted/hub/home",
      "Cookie": "jupyterhub-hub-login=[secret]; oauthenticator-state=[secret]; cognito-refresh-token=[secret]; jupyterhub-session-id=[secret]; _xsrf=[secret]",
      "Accept-Language": "en-US,en;q=0.9",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36",
      "Host": "redacted",
      "Connection": "close"
    }

Can you share what version of jupyterhub and the helm chart? Do you have any custom templates? Have you specified the version of the hub image? Can you share your config yaml file(s) (with secrets redacted)?

This sounds to me like you have jupyterhub 2.0, but a custom template (or outdated template) from 1.x.

I think I have the same problem, using template 1.x and jupyterhub 2.0.
Is there solution to fix it?
Thank You!

The solution is to use the 2.0 templates. Do you know how you have 1.x templates that aren’t getting updated?