500:internal server error while trying to open python notebook on JupyterHub

Hello everyone,

I am currently struggling with jupyterhub. When i try to open a .ipynb file i face a error of “500: internal server error”

I have installed it on a Virtual machine running Ubuntu 20.04.

I believe when i was trying to create a new environment, i may have deleted an old kernel that i had created before, and this error started for me.

i am pretty new to Linux and JupyterHub and have been trying some solutions mentioned here in the community, so far nothing seems to have worked for me.

i tried to install the missing files mentioned in the above screenshot, but after restarting the server they are again not installed.

Also when i try to launch jupyter hub from the console i get an error :

“Failed to find proxy [‘configurable-http-proxy’]
The proxy can be installed with npm install -g configurable-http-proxy.To install npm, install nodejs which includes npm.If you see an EACCES error or permissions error, refer to the npm documentation on How To Prevent Permissions Errors.”

“FileNotFoundError: [Errno 2] No such file or directory: ‘configurable-http-proxy’”

Any help would be appreciated, if anyone is aware of the issue i am facing please do let me know.

Thank you in advance.

Hello,

seems like it is a system wide issue. Since i am not able to run ipynb files even on jupyter notebook.

The error details:
(base) nak4si@SI-V-00003:~$ jupyter notebook
[I 2021-06-25 13:17:18.809 LabApp] JupyterLab extension loaded from /home/nak4si/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 2021-06-25 13:17:18.809 LabApp] JupyterLab application directory is /home/nak4si/anaconda3/share/jupyter/lab
[I 13:17:18.816 NotebookApp] Serving notebooks from local directory: /home/nak4si
[I 13:17:18.816 NotebookApp] Jupyter Notebook 6.4.0 is running at:
[I 13:17:18.816 NotebookApp] http://localhost:8888/?token=5c8a3fbd39049d0be3ce2c0edb37d26ce84e192db4bcd805
[I 13:17:18.816 NotebookApp] or http://127.0.0.1:8888/?token=5c8a3fbd39049d0be3ce2c0edb37d26ce84e192db4bcd805
[I 13:17:18.816 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 13:17:18.879 NotebookApp]

To access the notebook, open this file in a browser:
    file:///home/nak4si/.local/share/jupyter/runtime/nbserver-256287-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=5c8a3fbd39049d0be3ce2c0edb37d26ce84e192db4bcd805
 or http://127.0.0.1:8888/?token=5c8a3fbd39049d0be3ce2c0edb37d26ce84e192db4bcd805

[I 13:17:24.208 NotebookApp] Creating new notebook in
[E 13:17:24.510 NotebookApp] Uncaught exception GET /notebooks/Untitled10.ipynb?kernel_name=python3 (127.0.0.1)
HTTPServerRequest(protocol=‘http’, host=‘localhost:8888’, method=‘GET’, uri=’/notebooks/Untitled10.ipynb?kernel_name=python3’, version=‘HTTP/1.1’, remote_ip=‘127.0.0.1’)
Traceback (most recent call last):
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/tornado/web.py”, line 1704, in _execute
result = await result
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/tornado/gen.py”, line 775, in run
yielded = self.gen.send(value)
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/notebook/handlers.py”, line 101, in get
get_frontend_exporters=get_frontend_exporters
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/base/handlers.py”, line 516, in render_template
return template.render(**ns)
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/jinja2/environment.py”, line 1289, in render
self.environment.handle_exception()
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/jinja2/environment.py”, line 924, in handle_exception
raise rewrite_traceback_stack(source=source)
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/templates/notebook.html”, line 1, in top-level template code
{% extends “page.html” %}
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/templates/page.html”, line 154, in top-level template code
{% block header %}
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/templates/notebook.html”, line 115, in block ‘header’
{% for exporter in get_frontend_exporters() %}
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/notebook/handlers.py”, line 40, in get_frontend_exporters
for name in get_export_names():
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/base.py”, line 146, in get_export_names
e = get_exporter(exporter_name)(config=config)
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/base.py”, line 103, in get_exporter
if getattr(exporter(config=config), ‘enabled’, True):
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/templateexporter.py”, line 330, in init
super().init(config=config, **kw)
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/exporter.py”, line 114, in init
self._init_preprocessors()
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/templateexporter.py”, line 497, in _init_preprocessors
conf = self._get_conf()
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/templateexporter.py”, line 517, in _get_conf
if conf_path.exists():
File “/home/nak4si/anaconda3/lib/python3.7/pathlib.py”, line 1361, in exists
self.stat()
File “/home/nak4si/anaconda3/lib/python3.7/pathlib.py”, line 1183, in stat
return self._accessor.stat(self)
PermissionError: [Errno 13] Permission denied: ‘/usr/local/share/jupyter/nbconvert/templates/conf.json’
[E 13:17:24.525 NotebookApp] {
“Host”: “localhost:8888”,
“User-Agent”: “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0”,
“Accept”: “text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8”,
“Accept-Language”: “en-US,en;q=0.5”,
“Accept-Encoding”: “gzip, deflate”,
“Connection”: “keep-alive”,
“Referer”: “http://localhost:8888/tree”,
“Cookie”: “username-localhost-8888=“2|1:0|10:1624619840|23:username-localhost-8888|44:YmNjM2Y5ZWVmY2RhNDNiNjg4ZjI1YTBmNDI0OWFkZDI=|f413f6a723fd640568f8523bd9612cfa60d0985d7ea22e7679a73675fc1aecc3”; _xsrf=2|75f08fec|7fb2f9de88df51d1104947546e40b512|1624604371”,
“Upgrade-Insecure-Requests”: “1”
}
[E 13:17:24.525 NotebookApp] 500 GET /notebooks/Untitled10.ipynb?kernel_name=python3 (127.0.0.1) 236.920000ms referer=http://localhost:8888/tree

I am not sure what can be doone to solve this.

Thanks in advance for any support.

Hi! Please could you give us full details of how you installed JupyterHub, including any changes you made to your operating system configuration.

Hello,

Thank you for your response.

I am trying to install JupyterHub on a server that is running Windows server 2012 R2. I have installed Virtual box to install VM that runs Ubuntu 20.04.

In the VM i have followed the steps mentioned in the following link: Installing on your own server — The Littlest JupyterHub v0.1 documentation

i have completed the steps till Step 2, where i have made various users (all have a common default password “jupyter”) when i tried to change i was getting “500: server error”

I left it there to further install my packages and create an environment for runnung the python codes.

i could open the python notebooks at this point in time and run them. i wanted to make a common environment and a shared folder for all users to have access.

I had created a kernel under my username as i was used to in jupyter notebooks and anaconda in Windows. But i was not able to install packages properly. SO i deleted the kernel and tried to create a new one.

after this i was not able to open or create any .ipynb files in jupyterhub. The server can be accessed with the IP i had set up before but not using the terminal as far as i can understand since i am getting “configurable-http-proxy” error. I am using HTTP and have not set up HTTPS as mentioned in the installation steps.

I am also confused if the terminal that can be accessed in Jupyterhub through the browser is the main terminal to setup the environment, kernel and the packages or the terminal in the OS can also be used to do the same. Since i have a little experience in anaconda navigator in windows i never faced issues like this and i am also new to Linux and trying to learn how to use it.

Is there any further details that i can give for you to further assist me with this problem?

I would like to thank you in advance for taking the time to help me :slight_smile:

Edit: As i try to create ot open a ipynb file i get this error in Jupyternotebook in terminal

(base) nak4si@SI-V-00003:/$ jupyter notebook
[I 11:08:19.453 NotebookApp] Loading IPython parallel extension
[I 2021-06-28 11:08:20.329 LabApp] JupyterLab extension loaded from /home/nak4si/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 2021-06-28 11:08:20.329 LabApp] JupyterLab application directory is /home/nak4si/anaconda3/share/jupyter/lab
[I 11:08:20.336 NotebookApp] Serving notebooks from local directory: /
[I 11:08:20.336 NotebookApp] Jupyter Notebook 6.4.0 is running at:
[I 11:08:20.336 NotebookApp] http://localhost:8888/?token=1440e24dde8d4c46a258528568d99925327527f82c718b7d
[I 11:08:20.336 NotebookApp] or http://127.0.0.1:8888/?token=1440e24dde8d4c46a258528568d99925327527f82c718b7d
[I 11:08:20.336 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:08:20.412 NotebookApp]

To access the notebook, open this file in a browser:
    file:///home/nak4si/.local/share/jupyter/runtime/nbserver-932488-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=1440e24dde8d4c46a258528568d99925327527f82c718b7d
 or http://127.0.0.1:8888/?token=1440e24dde8d4c46a258528568d99925327527f82c718b7d

[I 11:08:27.975 NotebookApp] Creating new notebook in
[W 11:08:27.993 NotebookApp] 403 POST /api/contents (127.0.0.1): Permission denied: Untitled.ipynb
[W 11:08:27.994 NotebookApp] Permission denied: Untitled.ipynb
[W 11:08:27.994 NotebookApp] 403 POST /api/contents (127.0.0.1) 21.370000ms referer=http://localhost:8888/tree
[E 11:08:48.639 NotebookApp] Uncaught exception GET /notebooks/home/nak4si/Untitled.ipynb (127.0.0.1)
HTTPServerRequest(protocol=‘http’, host=‘localhost:8888’, method=‘GET’, uri=’/notebooks/home/nak4si/Untitled.ipynb’, version=‘HTTP/1.1’, remote_ip=‘127.0.0.1’)
Traceback (most recent call last):
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/tornado/web.py”, line 1704, in _execute
result = await result
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/tornado/gen.py”, line 775, in run
yielded = self.gen.send(value)
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/notebook/handlers.py”, line 101, in get
get_frontend_exporters=get_frontend_exporters
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/base/handlers.py”, line 516, in render_template
return template.render(**ns)
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/jinja2/environment.py”, line 1289, in render
self.environment.handle_exception()
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/jinja2/environment.py”, line 924, in handle_exception
raise rewrite_traceback_stack(source=source)
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/templates/notebook.html”, line 1, in top-level template code
{% extends “page.html” %}
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/templates/page.html”, line 154, in top-level template code
{% block header %}
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/templates/notebook.html”, line 115, in block ‘header’
{% for exporter in get_frontend_exporters() %}
File “/home/nak4si/anaconda3/lib/python3.7/site-packages/notebook/notebook/handlers.py”, line 40, in get_frontend_exporters
for name in get_export_names():
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/base.py”, line 146, in get_export_names
e = get_exporter(exporter_name)(config=config)
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/base.py”, line 103, in get_exporter
if getattr(exporter(config=config), ‘enabled’, True):
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/templateexporter.py”, line 330, in init
super().init(config=config, **kw)
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/exporter.py”, line 114, in init
self._init_preprocessors()
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/templateexporter.py”, line 497, in _init_preprocessors
conf = self._get_conf()
File “/home/nak4si/.local/lib/python3.7/site-packages/nbconvert/exporters/templateexporter.py”, line 517, in _get_conf
if conf_path.exists():
File “/home/nak4si/anaconda3/lib/python3.7/pathlib.py”, line 1361, in exists
self.stat()
File “/home/nak4si/anaconda3/lib/python3.7/pathlib.py”, line 1183, in stat
return self._accessor.stat(self)
PermissionError: [Errno 13] Permission denied: '/usr/local/share/jupyter/nbconvert/templates/html/conf.json’
[E 11:08:48.650 NotebookApp] {
“Host”: “localhost:8888”,
“User-Agent”: “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0”,
“Accept”: “text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8”,
“Accept-Language”: “en-US,en;q=0.5”,
“Accept-Encoding”: “gzip, deflate”,
“Connection”: “keep-alive”,
“Referer”: “http://localhost:8888/tree/home/nak4si”,
“Cookie”: “username-localhost-8888=“2|1:0|10:1624871302|23:username-localhost-8888|44:YWQ0MmUzMzU1Yjg5NDljMDhjZGEwNWQ1ZDBmNmVlM2Y=|b98da232dd3e87e8fa1fab2eaae90d7fbc87919aef5221480182f843be802782”; _xsrf=2|75f08fec|7fb2f9de88df51d1104947546e40b512|1624604371”,
“Upgrade-Insecure-Requests”: “1”
}
[E 11:08:48.650 NotebookApp] 500 GET /notebooks/home/nak4si/Untitled.ipynb (127.0.0.1) 235.850000ms referer=http://localhost:8888/tree/home/nak4si

It looks like you’re running that from the root directory /? If so you won’t have permission to write there so that error is expected. What happens if you run it from your home directory?

I get the same error. I even tried using anaconda-navigator.

When checked in the file manager the “conf.json” files doesn’t exist.

This Permission error is caused due to the version of nbconvert. nbconvert 6.1.0 was the reason for this error. I have downgraded the nbconvert to 5.6.1 and it fixed the issue for me. I no longer face the Permission error any more while trying to open .ipynb files.

1 Like