500: Internal Server Error

Hello,
I’m pretty new to Jupyter. I only use it for Udacity and I am trying to download my R project as a jupyter notebook .ipynb file. It gives me the error 500: Internal Server Error. I have tried restarting the notebook. Could someone help me please?

Have you checked the error logs from the command line / terminal?

Hello,
Thank you for replying. I really appreciate it.

How do I do that? Would I be able to do that if the Jupyter notebook is in the udacity website?

If it is the JupyterHub that is run by udacity, I suggest you to contact them! Most of the times, when you see a 500 error message somewhere in the web, it is a good time to contact the system administrator. You are not expected to fix their systems.

The first thing you need to know about an 500 Internal Server Error is that the error can only be resolved by fixes to the Web server software. It is not a client-side problem meaning that the problem is not with our plugin. This is a ‘catch-all’ error generated by the Web server. Basically something has gone wrong, but the server can not be more specific about the error condition in its response to the client. In addition to the 500 Internal Server Error notified back to the client, the Web server should generate some kind of internal error log which gives more details of what went wrong. It is up to the operators of the Web server site to locate and analyse the logs which should give further information about the error. However, there are often ways to quickly get around the problem:

  • Reload the web page.
  • Clear your browser cookies and cache
  • Come back later.
  • Finally, Ask your Hosting Provider

I have somewhat similar problem “500: Internal Server Error” which occurs when I try to reach the Admin console. Below is the logs from my running hub pod. I have taken a look at the admin.html file but I can’t get the meaning of the exception. If someone can help interpret this error, i will very much appreciate.

Just to note that this happens with my customized template but does not occur with the default template. I am therefore convince this was introduce by me customizing the login.html file. everything works well but for the admin console. Here is my customize login (https://uncg-jupyterhub.eastus.cloudapp.azure.com)

Below is the log from the hub pod

    HTTPServerRequest(protocol='https', host='uncg-jupyterhub.eastus.cloudapp.azure.com', method='GET', uri='/hub/admin', version='HTTP/1.1', remote_ip='10.240.0.128')
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1703, in _execute
        result = await result
      File "/usr/local/lib/python3.6/dist-packages/jupyterhub/handlers/pages.py", line 464, in get
        server_version='{} {}'.format(__version__, self.version_hash),
      File "/usr/local/lib/python3.6/dist-packages/jupyterhub/handlers/base.py", line 1120, in render_template
        return template.render(**template_ns)
      File "/usr/local/lib/python3.6/dist-packages/jinja2/environment.py", line 1090, in render
        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 "/etc/jupyterhub/custom/templates/admin.html", line 7, in top-level template code
        fa-sort-asc
      File "/etc/jupyterhub/custom/templates/page.html", line 173, in top-level template code
        {% block main %}
      File "/etc/jupyterhub/custom/templates/admin.html", line 90, in block "main"
        {#- user row -#}
      File "/usr/local/lib/python3.6/dist-packages/jinja2/environment.py", line 471, in getattr
        return getattr(obj, attribute)
    jinja2.exceptions.UndefinedError: 'pagination' is undefined```

What version of JupyterHub are you using, and what did you base your custom template on?

Pagination in admin.html was added in


which isn’t yet in a released version of JupyterHub

my jupyterhub is version 1.1.0 and my custom template was based on https://github.com/jupyterhub/jupyterhub/tree/master/share/jupyterhub/templates, as recent as July 19 when I download the templates. should I go back to version 1.0.0 or something?

You should ensure your templates match your version of JupyterHub. For instance, the templates for 1.1.0 are here: https://github.com/jupyterhub/jupyterhub/tree/1.1.0/share/jupyterhub/templates

Thanks, That solved the problem. I will pay attention next time

1 Like