Dead kernel in Jupyter Notebook

I am running my JupyterHub on a Virtual Machine hosted at my university. The VM is running on Ubuntu 20.04 LTS. When I launch JupyterHub from the LMS of my university it opens the hub successfully. But when I try to create a new notebook (Python 3) it shows a broken/dead kernel. And also I cannot open the terminal from the hub.

Below is the Dockerfile contents:

FROM jupyterhub/jupyterhub:latest

# RUN apt-get upgrade -y

# ADD /srv/jupyterhub/

# # Download script to automatically stop idle single-user servers
# #RUN wget

# RUN pip install \
#     dockerspawner==0.10.0 \
#     jupyterhub-ltiauthenticator==1.1

# #RUN pip install jupyterhub-ltiauthenticator==1.1

# #RUN pip install ipython
# #RUN python3 -m pip install 'ipykernel==5.3.0'
# #RUN python3 -m pip install 'ipython==7.15.0'
# #RUN python3 -m pip install 'jupyter-client==6.1.3'
# #RUN python3 -m pip install 'jupyter-core==4.6.3'
# #RUN python3 -m pip install 'tornado==4.5.3'
# RUN python3 -m pip install ipykernel
# RUN python3 -m ipykernel install --user

Not sure what is wrong with the setup. Any workaround for this issue?

Hi! Are there any errors or warnings in your browser console?

Can you give us full information on how you setup JupyterHub on your VM?

Getting all the way to starting a kernel, but then failing to connect usually points to a proxy not handling websockets. Is there perhaps an nginx/apache/other gateway between you and JupyterHub? Are you able to start a terminal? If no, proxied websockets are almost certainly the issue.

No even I cannot start the terminal. Also tried with JupyterLab and below it says Python 3 (ipykernel) as connecting but not getting it ready.

We are using Capistrano to build our Jupyterhub on the VM using the docker then create the single-user instance for each user. Also, we are using LTI for authentication. We are using some of the motivation from this for technical aspects: Marvin Kastner / minimal-jupyterhub-docker-config · GitLab

@minrk , I kind of get the idea now where the issue is from. Can you please provide some more details on how this issue could be fixed? Is it inside a Jupyter config file or on the VM?

It shouldn’t be in anything Jupyter-related. It will depend on what the proxy is, but it will need to support websockets. Searching the proxy name and websockets might be the way to go.

We have some sample configurations of working reverse proxies.

1 Like

Yes, the issue is now resolved. Like you mentioned earlier the problem was in the WebSockets. !

Just to clarify the solution in case someone else faces the issue.
As it finally turned out, the Nginx proxy configuration was not yet adapted to handling websockets. The admin only added the two options to the Nginx configuration:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “Upgrade”;
That solved the problem.

Thanks @minrk and @manics for your help :slight_smile:

1 Like