TLJH + docker : how to restart jupyterhub?

Hello here, I am totally new to jupyterhub (and docker) so sorry if my question is stupid, but I am unable to restart jupyterhub after stopping the container in which it runs.

More precisely : all I wanted was to install Jupyterhub on my computer to try it out (play with it). So I followed this tutorial to install it locally within a docker container. Everything went perfectly. Once I was done with my day, I stopped the container and my computer.

The day after, I want to go back to my TLJH, and… I don’t know how to do that? I obviously restart the said Docker container, but then I have to tell TLJH to “restart” so it serves me the service on my localhost, and I cannot figure how to do this.

First thing I did was to try to reinstall TLJH with python3 /srv/src/bootstrap/bootstrap.py --admin admin but it returned an error (see below).
I tried tljh-config reload, which returned the same error.
Same with what is discussed here.

At this point I feel like I am doing something completely wrong. Any help or suggestion would be appreciated.

The said error:

Failed to connect to bus: No such file or directory
Traceback (most recent call last):
  File "/usr/bin/tljh-config", line 11, in <module>
    load_entry_point('the-littlest-jupyterhub==0.1', 'console_scripts', 'tljh-config')()
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/config.py", line 410, in main
    reload_component(args.component)
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/config.py", line 267, in reload_component
    systemd.restart_service('jupyterhub')
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/systemd.py", line 70, in restart_service
    ], check=True)
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['systemctl', 'restart', 'jupyterhub']' returned non-zero exit status 1.

Those instructions are only intended for developing TLJH, as you’ve discovered you can run into problems when trying to use it as a persistent JupyterHub. Since you’re new to JupyterHub you’re probably better off trying TLJH in a virtual machine instead.

It sounds like your error may be due problems with systemd inside Docker. If you delete the Docker container (docker rm tljh-dev) and bring up a new one from scratch does it work?

It sounds like your error may be due problems with systemd inside Docker. If you delete the Docker container ( docker rm tljh-dev ) and bring up a new one from scratch does it work?

Yes redoing everything from scratch works perfectly.

Those instructions are only intended for developing TLJH, as you’ve discovered you can run into problems when trying to use it as a persistent JupyterHub. Since you’re new to JupyterHub you’re probably better off trying TLJH in a virtual machine instead.

Too bad. After Trying on an Amazon server (free trial doesn’t have enough RAM) and with the Windows Subsystem for Linux (systemd not operational) I thought Docker was the way to go. I’ll give a try to a VM!

Thanks!

1 Like